*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#fff;color:#111}button,input{font:inherit}.view{min-height:100vh}.brand{text-align:center;font-weight:800;font-size:44px;padding:42px 20px 70px}.card{width:min(760px,calc(100% - 32px));margin:0 auto 24px;border:1px solid #ddd;border-radius:28px;padding:40px;background:#fff;box-shadow:0 10px 35px rgba(0,0,0,.04)}h1{font-size:40px;margin:0 0 12px}.muted{color:#777}label{display:block;font-weight:700;margin:24px 0 8px}input{width:100%;padding:18px;border:1px solid #d5d5d5;border-radius:18px;background:#fff;outline:none}input:focus{border-color:#111}.primary,.secondary{border:0;border-radius:18px;padding:17px 20px;font-weight:700;cursor:pointer}.primary{background:#111;color:#fff}.primary:disabled{opacity:.5;cursor:default}.card .primary{width:100%;margin-top:26px}.linkBtn{display:block;margin:22px auto 0;border:0;background:none;text-decoration:underline;cursor:pointer}.message{width:min(760px,calc(100% - 32px));margin:18px auto;padding:16px 18px;border-radius:16px}.hidden{display:none!important}.topbar{display:flex;justify-content:space-between;align-items:center;padding:22px 28px;border-bottom:1px solid #ddd}.secondary{background:#eee;color:#111}.layout{display:grid;grid-template-columns:330px 1fr;min-height:calc(100vh - 83px)}.sidebar{border-right:1px solid #ddd;padding:24px}.sectionTitle{font-size:25px;font-weight:800;margin-bottom:16px}.search{margin-bottom:16px;padding:14px;border-radius:14px}.user{display:block;width:100%;text-align:left;border:1px solid #ddd;background:#fafafa;border-radius:18px;padding:16px;margin-bottom:10px;cursor:pointer}.user:hover{background:#f1f1f1}.user strong{font-size:18px}.chat{display:flex;flex-direction:column;min-width:0;min-height:0}.chatHeader{padding:24px;border-bottom:1px solid #ddd}.messages{flex:1;min-height:0;overflow:auto;padding:24px;overflow-anchor:none}.empty{text-align:center;color:#888;margin-top:25vh}.bubble{max-width:min(70%,600px);padding:10px 14px;margin:8px 0;border-radius:16px}.mine{margin-left:auto;background:#111;color:#fff}.theirs{margin-right:auto;background:#eee}.time{font-size:11px;opacity:.65;margin-top:5px}.composer{display:flex;gap:10px;padding:16px;border-top:1px solid #ddd}.composer input{flex:1}.composer button{width:60px}@media(max-width:800px){.layout{grid-template-columns:1fr}.sidebar{border-right:0;border-bottom:1px solid #ddd;max-height:42vh;overflow:auto}.chat{min-height:58vh}.brand{font-size:36px;padding-bottom:40px}.card{padding:28px}h1{font-size:34px}.bubble{max-width:85%}}

.errorBox{padding:18px;line-height:1.5;color:#b00020;white-space:normal;}

.messageActions{display:flex;gap:6px;margin-top:7px;flex-wrap:wrap}.miniBtn{border:0;border-radius:10px;padding:6px 8px;background:rgba(127,127,127,.16);color:inherit;font-size:12px;cursor:pointer}.reactions{display:flex;gap:4px;flex-wrap:wrap;margin-top:7px}.reactionBtn{border:1px solid rgba(127,127,127,.25);border-radius:999px;background:rgba(127,127,127,.08);color:inherit;padding:4px 7px;font-size:14px;cursor:pointer}.reactionBtn span{font-size:11px;font-weight:700;margin-left:2px}.premiumReaction{box-shadow:0 0 0 1px rgba(0,0,0,.10);font-weight:700}.deletedBody{font-style:italic;opacity:.7}.mine .reactionBtn,.mine .miniBtn{background:rgba(255,255,255,.13);border-color:rgba(255,255,255,.25)}


.notificationBar{
  position:fixed;
  left:16px;
  right:16px;
  top:max(16px, env(safe-area-inset-top));
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border:1px solid #ddd;
  border-radius:16px;
  background:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.14);
}
.notificationBar.hidden{display:none}
.notificationText{margin-top:3px;color:#666;max-width:80%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.notificationClose{
  border:0;
  background:#f1f1f1;
  border-radius:10px;
  width:36px;height:36px;
  font-size:24px;
  line-height:1;
}
@media (max-width:700px){
  .topbar{gap:6px;flex-wrap:wrap}
  #enableNotificationsBtn{font-size:13px}
}

/* ---------- Profiles & avatars ---------- */
.topIdentity{display:flex;align-items:center;gap:10px;min-width:0}.identityText{display:flex;flex-direction:column;gap:2px}.topAvatarButton,.avatarButton,.chatAvatarButton{border:0;background:none;padding:0;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.topAvatarButton{width:42px;height:42px}.topAvatar{width:42px;height:42px;border-radius:50%;object-fit:cover;background:#111;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:15px}.topActions{display:flex;gap:8px;align-items:center}.user{display:flex;align-items:center;gap:12px}.avatarButton{flex:0 0 auto}.userAvatar{width:48px;height:48px;border-radius:50%;object-fit:cover;background:#111;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:800}.userMain{flex:1;text-align:left;border:0;background:none;padding:0;cursor:pointer;min-width:0}.userMain strong{font-size:18px}.chatHeader{display:flex;align-items:center;gap:12px}.chatBackBtn{width:42px;height:42px;flex:0 0 42px;border:1px solid #ddd;border-radius:50%;background:#fff;color:#111;display:inline-flex;align-items:center;justify-content:center;font-size:32px;line-height:1;cursor:pointer;padding:0 0 4px;transition:background .15s,border-color .15s,transform .15s}.chatBackBtn:hover{background:#f3f3f3;border-color:#cfcfcf}.chatBackBtn:active{transform:scale(.94)}.chatBackBtn:focus-visible{outline:2px solid #111;outline-offset:2px}.chatAvatarButton{width:48px;height:48px;flex:0 0 48px}.chatAvatar{width:48px;height:48px;border-radius:50%;object-fit:cover;background:#111;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:800}.chatHeaderInfo{border:0;background:none;text-align:left;cursor:pointer;display:flex;flex-direction:column;align-items:flex-start;gap:2px}.chatHeaderInfo strong{font-size:18px}.chatDeleteBtn{width:38px;height:38px;flex:0 0 38px;border:1px solid #ddd;border-radius:50%;background:#fff;color:#555;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;font-size:17px;transition:background .15s,border-color .15s,transform .15s}.chatDeleteBtn:hover{background:#f3f3f3;border-color:#bbb}.chatDeleteBtn:active{transform:scale(.93)}.chatDeleteBtn:focus-visible{outline:2px solid #111;outline-offset:2px}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.42);z-index:10000;display:flex;align-items:center;justify-content:center;padding:18px}.profileCard{position:relative;width:min(520px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:28px;padding:30px;box-shadow:0 20px 60px rgba(0,0,0,.2);text-align:center}.modalClose{position:absolute;right:16px;top:14px;border:0;background:#eee;border-radius:50%;width:38px;height:38px;font-size:25px;cursor:pointer}.profileModalAvatar{display:flex;justify-content:center;margin:8px 0 18px}.profileAvatar{width:112px;height:112px;border-radius:50%;object-fit:cover;background:#111;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:38px}.profileCard h2{font-size:30px;margin:0 0 5px}.profileUsername{color:#777;font-size:18px}.profileStatus{margin-top:8px;color:#777}.profileEditArea{text-align:left;margin-top:20px}.profileEditArea label{margin-top:16px}.profileHint{font-size:13px;color:#777;line-height:1.4;margin-top:8px}.profileActions{display:flex;gap:10px;margin-top:22px}.profileActions button{flex:1}.hidden{display:none!important}
@media(max-width:700px){.profileTopBtn{display:none}.topbar{padding:16px}.profileCard{padding:26px 20px}.userAvatar{width:46px;height:46px}}

.chatSecurityBtn{margin-left:auto;width:42px;height:42px;border:1px solid #ddd;border-radius:50%;background:#fff;cursor:pointer;font-size:18px;display:inline-flex;align-items:center;justify-content:center}.chatSecurityBtn:hover{background:#f3f3f3}.chatSecurityBtn:active{transform:scale(.94)}.chatSecurityBtn:focus-visible{outline:2px solid #111;outline-offset:2px}

/* ---------- Telegram-style pages / bottom navigation ---------- */
.appPage{min-height:calc(100vh - 83px);padding-bottom:90px}.pageHeading{display:flex;align-items:center;justify-content:space-between;padding:28px 28px 18px}.pageHeading h1{font-size:32px;margin:0 0 4px}.pageHeading p{margin:0}.settingsPageInner{max-width:860px;margin:0 auto;padding:0 20px 40px}.settingsHeading{padding-left:0;padding-right:0}.settingsProfileCard{width:100%;display:flex;align-items:center;gap:16px;text-align:left;border:1px solid #ddd;background:#fff;border-radius:24px;padding:18px 20px;cursor:pointer;box-shadow:0 8px 25px rgba(0,0,0,.04)}.settingsAvatar{width:70px;height:70px;flex:0 0 70px;border-radius:50%;display:flex;align-items:center;justify-content:center;overflow:hidden}.settingsAvatarImg{width:70px;height:70px;border-radius:50%;object-fit:cover;background:#111;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:24px}.settingsProfileText{display:flex;flex-direction:column;gap:4px;min-width:0}.settingsProfileText strong{font-size:22px}.settingsProfileText .muted{font-size:16px}.settingsChevron{margin-left:auto;font-size:32px;color:#aaa;line-height:1}.settingsGroup{margin-top:18px;border:1px solid #ddd;border-radius:24px;overflow:hidden;background:#fff}.settingsRow{width:100%;display:flex;align-items:center;gap:14px;text-align:left;border:0;border-bottom:1px solid #eee;background:#fff;padding:18px 20px;cursor:pointer}.settingsRow:last-child{border-bottom:0}.settingsRow:active,.settingsProfileCard:active{background:#f5f5f5}.settingsIcon{width:42px;height:42px;border-radius:13px;background:#f1f1f1;display:inline-flex;align-items:center;justify-content:center;font-size:21px;flex:0 0 42px}.settingsRow span:nth-child(2){display:flex;flex-direction:column;gap:3px}.settingsRow small{color:#777;font-size:13px}.settingsLogout{width:100%;margin-top:18px;border:1px solid #f0caca;background:#fff3f3;color:#b00020;border-radius:18px;padding:16px;font-weight:700;cursor:pointer}.bottomNav{position:fixed!important;left:12px!important;right:12px!important;bottom:calc(10px + env(safe-area-inset-bottom))!important;width:auto!important;max-width:760px;margin:0 auto!important;transform:none!important;z-index:2147483000!important;display:flex;align-items:stretch;gap:4px;padding:7px;border:1px solid #ddd;border-radius:24px;background:rgba(255,255,255,.96);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:0 12px 35px rgba(0,0,0,.14);contain:layout paint;isolation:isolate}.navItem{min-width:130px;border:0;background:transparent;border-radius:18px;padding:9px 18px;color:#777;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:7px}.navItem span{font-size:20px}.navItem strong{font-size:15px}.navItem.active{background:#eee;color:#111}.bottomNav.chatHidden{display:none}.topbar{position:sticky;top:0;z-index:1000;background:rgba(255,255,255,.94);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
@media(max-width:800px){.appPage{min-height:calc(100vh - 74px);padding-bottom:105px}.pageHeading{padding:20px 16px 12px}.pageHeading h1{font-size:30px}.layout{display:block;min-height:calc(100vh - 160px)}.sidebar{max-height:none;padding:14px 16px 10px}.sectionTitle{font-size:22px}.search{margin-bottom:10px}.chat{min-height:calc(100vh - 330px)}.bottomNav{width:calc(100% - 28px);justify-content:space-around}.navItem{flex:1;min-width:0;padding:10px 12px}.navItem span{font-size:18px}.navItem strong{font-size:14px}.settingsPageInner{padding:0 16px 30px}.settingsProfileCard{padding:16px}.settingsAvatar,.settingsAvatarImg{width:62px;height:62px;flex-basis:62px}.settingsProfileText strong{font-size:20px}.topActions #logoutBtn{display:none}.topbar{padding:12px 16px}.topIdentity .identityText strong{font-size:17px}.topIdentity .muted{font-size:12px}}
.settingsEditProfileTop{width:100%;margin-top:16px;border:0;border-radius:18px;background:#111;color:#fff;padding:15px 18px;font-size:16px;font-weight:800;cursor:pointer;box-shadow:0 8px 20px rgba(0,0,0,.12)}
.settingsEditProfileTop:active{transform:scale(.99);background:#222}
.avatarEditor{display:flex;flex-direction:column;align-items:center;gap:14px;margin-top:10px}
.profileEditAvatarPreview{width:108px;height:108px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#111}
.profileEditAvatar{width:108px;height:108px;border-radius:50%;object-fit:cover;background:#111;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:32px}
.avatarEditorActions{display:flex;gap:10px;width:100%}
.avatarEditorActions .secondary{flex:1;border:1px solid #ddd;background:#f7f7f7;border-radius:14px;padding:12px;font-weight:700;cursor:pointer}
.avatarUploadLoading{font-size:14px;color:#fff;font-weight:700}

/* ---------- Top quick actions / avatar picker ---------- */
.topActions{display:flex;align-items:center;gap:10px}
.topIconButton{width:44px;height:44px;flex:0 0 44px;border:1px solid #ddd;border-radius:50%;background:#fff;color:#111;display:inline-flex;align-items:center;justify-content:center;padding:0;font-size:21px;line-height:1;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.06);transition:transform .15s,background .15s,border-color .15s}
.topIconButton:hover{background:#f4f4f4;border-color:#ccc}
.topIconButton:active,.topAvatarButton:active{transform:scale(.94)}
.topIconButton:focus-visible,.topAvatarButton:focus-visible{outline:2px solid #111;outline-offset:2px}
.topAvatarButton{width:44px;height:44px;flex:0 0 44px;border:1px solid #ddd;border-radius:50%;background:#111;color:#fff;overflow:hidden;box-shadow:0 4px 14px rgba(0,0,0,.08)}
.topAvatarButton .topAvatar{width:100%;height:100%;border-radius:50%;font-size:15px}
.quickAvatarCard{position:relative;width:min(390px,100%);background:#fff;border-radius:26px;padding:26px 22px 22px;box-shadow:0 20px 60px rgba(0,0,0,.22);text-align:center}
.quickAvatarPreview{width:112px;height:112px;border-radius:50%;overflow:hidden;margin:4px auto 14px;background:#111;color:#fff;display:flex;align-items:center;justify-content:center}
.quickAvatarPreview .quickAvatarImg{width:112px;height:112px;border-radius:50%;object-fit:cover;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:34px}
.quickAvatarCard h2{font-size:24px;margin:0 0 6px}
.quickAvatarText{margin:0 auto 18px;max-width:290px;line-height:1.4}
.quickAvatarActions{display:flex;gap:10px}
.quickAvatarActions button{flex:1;border-radius:15px;padding:13px 10px;font-weight:800;cursor:pointer}
.quickAvatarProfileBtn{width:100%;margin-top:12px;border:0;background:#f1f1f1;color:#111;border-radius:15px;padding:13px;font-weight:700;cursor:pointer}
.quickAvatarProfileBtn:active{background:#e7e7e7}
@media(max-width:700px){.topIconButton,.topAvatarButton{width:42px;height:42px;flex-basis:42px}.quickAvatarCard{padding:24px 18px 18px}}
.topAvatarPlaceholder{font-size:22px!important;line-height:1}

/* Startup splash: shown until authentication state is known. */
.startupSplash{position:fixed;inset:0;z-index:20000;display:flex;align-items:center;justify-content:center;background:#fff;color:#111;font-size:42px;font-weight:800;letter-spacing:-1px;text-align:center;padding:24px;}
.startupSplash.isHidden{display:none;}
.startupWord{display:inline-flex;align-items:center;justify-content:center;min-height:1.1em;white-space:nowrap;}
.startupLetter{display:inline-block;opacity:0;transform:translateY(8px) scale(.98);will-change:transform,opacity;}
@keyframes kmStartupLetter{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:700px){.startupSplash{font-size:36px;}}

.chatBackComposerBtn{width:52px;height:52px;flex:0 0 52px;border:1px solid #ddd;border-radius:16px;background:#fff;color:#111;display:inline-flex;align-items:center;justify-content:center;font-size:34px;line-height:1;cursor:pointer;padding:0 0 5px;box-shadow:0 4px 12px rgba(0,0,0,.06);transition:background .15s,border-color .15s,transform .15s}.chatBackComposerBtn:hover{background:#f4f4f4;border-color:#ccc}.chatBackComposerBtn:active{transform:scale(.94)}.chatBackComposerBtn:focus-visible{outline:2px solid #111;outline-offset:2px}.composer .chatBackComposerBtn.hidden{display:none!important}@media(max-width:800px){.chatBackComposerBtn{width:50px;height:50px;flex-basis:50px;border-radius:15px}}

/* ---------- Smooth mobile UX ---------- */
html { scroll-behavior: smooth; }
body { -webkit-tap-highlight-color: transparent; }
button, input { -webkit-appearance: none; }
.appPage, .chat, .sidebar, .settingsPageInner {
  transition: opacity .18s ease, transform .18s ease;
}
.user, .settingsProfileCard, .settingsRow, .navItem, .topIconButton, .topAvatarButton, .chatBackComposerBtn, .chatSecurityBtn {
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.user:active, .settingsProfileCard:active, .settingsRow:active, .navItem:active { transform: scale(.985); }
.bubble {
  animation: kmBubbleIn .18s ease-out both;
  will-change: transform, opacity;
}
@keyframes kmBubbleIn {
  from { opacity: 0; transform: translateY(5px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.messages {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.modal { animation: kmFadeIn .16s ease-out both; }
.quickAvatarCard, .profileCard { animation: kmCardIn .18s ease-out both; }
@keyframes kmFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes kmCardIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.startupSplash { animation: kmSplashIn .12s ease-out both; }
@keyframes kmSplashIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Stable composer back button on iPhone/Safari */
.composer{align-items:center}.composer .chatBackComposerBtn{display:inline-flex!important;width:50px!important;height:50px!important;min-width:50px!important;flex:0 0 50px!important;margin:0;padding:0 0 5px!important;border-radius:50%!important;font-size:32px!important;line-height:1!important;visibility:visible}.composer .chatBackComposerBtn.hidden{display:none!important}

/* Robust composer back button state: visible only while a chat is open. */
.composer .chatBackComposerBtn{display:none !important;visibility:hidden !important;opacity:0;pointer-events:none;transform:translateX(-4px);transition:opacity .16s ease,transform .16s ease;}
.composer.chatOpen .chatBackComposerBtn{display:inline-flex !important;visibility:visible !important;opacity:1;pointer-events:auto;transform:none;}

/* KARMADONOV monochrome icon system */
.topIconButton,
.settingsIcon,
.navItem span,
.profileTopBtn,
.chatBackComposerBtn,
.profileActions button,
.avatarEditorActions button {
  filter: grayscale(1) contrast(1.15);
}
.topIconButton,
.settingsIcon,
.navItem span,
.profileTopBtn,
.chatBackComposerBtn {
  color: #111 !important;
}


/* ---------- My Cups / coffee currency ---------- */
.cupsPageInner{max-width:760px;margin:0 auto;padding:0 20px 120px}.coffeeBalanceCard{margin-top:18px;border:1px solid #ddd;border-radius:26px;background:#111;color:#fff;padding:24px;display:flex;align-items:center;gap:18px;box-shadow:0 12px 30px rgba(0,0,0,.12)}.coffeeCupBig{width:74px;height:74px;border-radius:22px;background:#fff;color:#111;display:flex;align-items:center;justify-content:center;font-size:38px;filter:grayscale(1)}.coffeeBalanceCard>div:last-child{display:flex;flex-direction:column;gap:2px}.coffeeBalanceCard .muted{color:#bbb}.coffeeBalanceCard strong{font-size:42px;line-height:1}.coffeeUnit{font-size:14px;color:#bbb}.coffeeGiftCard,.coffeeHistoryCard{margin-top:18px;border:1px solid #ddd;border-radius:24px;background:#fff;padding:20px}.coffeeGiftCard h2,.coffeeHistoryCard h2{margin:0 0 6px;font-size:22px}.coffeeGiftCard p{margin:0 0 16px}.coffeeGiftCard select,.coffeeAmountRow input{width:100%;box-sizing:border-box;border:1px solid #ddd;border-radius:15px;background:#fff;padding:14px 15px;font-size:16px;color:#111;min-height:50px}.coffeeAmountRow{display:grid;grid-template-columns:1fr auto;gap:10px;margin-top:10px}.coffeeAmountRow .primary{min-width:150px;border-radius:15px}.coffeeMessage{margin-top:12px;border-radius:14px;padding:11px 13px;background:#f1f1f1;font-weight:600}.coffeeMessage.error{background:#fff0f0;color:#b00020}.coffeeHistoryHeader{display:flex;align-items:center;justify-content:space-between;gap:10px}.smallBtn{padding:9px 12px!important;border-radius:12px!important}.coffeeHistory{margin-top:12px;display:flex;flex-direction:column}.coffeeHistoryItem{display:flex;align-items:center;gap:12px;padding:13px 0;border-top:1px solid #eee}.coffeeHistoryItem:first-child{border-top:0}.coffeeHistoryIcon{width:42px;height:42px;border-radius:13px;background:#f1f1f1;display:flex;align-items:center;justify-content:center;font-size:21px;filter:grayscale(1)}.coffeeHistoryItem>div{display:flex;flex-direction:column;gap:3px;min-width:0}.coffeeHistoryItem small{color:#777}.coffeeHistoryAmount{margin-left:auto;font-size:18px}.coffeeHistoryAmount.in{color:#111}.coffeeHistoryAmount.out{color:#777}.bottomNav .navItem{min-width:120px}.bottomNav .navItem span{filter:grayscale(1) contrast(1.15)}
@media(max-width:800px){.cupsPageInner{padding:0 16px 120px}.coffeeBalanceCard{padding:20px}.coffeeBalanceCard strong{font-size:36px}.coffeeCupBig{width:64px;height:64px;font-size:32px}.bottomNav .navItem{min-width:0;flex:1}.bottomNav .navItem strong{font-size:12px}.bottomNav .navItem span{font-size:18px}}

/* Проверка уникального имени пользователя */
.profileUsernameStatus{min-height:20px;margin:6px 2px 0;font-size:14px;color:#777;line-height:1.3}
.profileUsernameStatus.ok{color:#188038}
.profileUsernameStatus.error{color:#c62828}
.profileUsernameStatus.checking{color:#777}
#profileSaveBtn:disabled{opacity:.45;cursor:not-allowed}
/* Telegram-like chat composer and header controls */
.chatHeader{min-height:72px;padding:12px 18px;gap:10px;background:#fff;position:relative}
.chatBackHeaderBtn{width:44px;height:44px;flex:0 0 44px;border:1px solid #ddd;border-radius:50%;background:#fff;color:#111;display:inline-flex;align-items:center;justify-content:center;font-size:32px;line-height:1;cursor:pointer;padding:0 0 5px;box-shadow:0 3px 12px rgba(0,0,0,.06);transition:transform .15s,background .15s}
.chatBackHeaderBtn:active{transform:scale(.94)}.chatBackHeaderBtn:hover{background:#f5f5f5}
.composer{align-items:center;background:#fff;padding:10px 14px;gap:8px}
.attachBtn{width:48px!important;height:48px!important;min-width:48px!important;flex:0 0 48px!important;border:1px solid #ddd!important;border-radius:50%!important;background:#fff!important;color:#111!important;font-size:25px!important;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 3px 10px rgba(0,0,0,.05)}
.attachBtn:active{transform:scale(.94)}
.composer input{height:50px;border-radius:25px;padding:12px 18px;background:#fff}
.composer>.primary{height:50px;width:50px!important;min-width:50px;padding:0!important;border-radius:50%!important;display:inline-flex;align-items:center;justify-content:center;font-size:22px}
.mediaBubble{padding:6px!important;overflow:hidden}.messageMediaImage,.messageMediaVideo{display:block;width:min(70vw,420px);max-width:100%;max-height:55vh;border-radius:14px;object-fit:contain;background:#111}.mediaLoading,.mediaError{display:block;padding:24px 18px;color:#777}.mine .mediaLoading,.mine .mediaError{color:#ddd}
@media(max-width:800px){.chatHeader{padding:10px 12px}.chatBackHeaderBtn{width:42px;height:42px;flex-basis:42px}.composer{padding:8px 10px}.attachBtn{width:46px!important;height:46px!important;min-width:46px!important;flex-basis:46px!important}.composer input{height:48px}.composer>.primary{height:48px;width:48px!important;min-width:48px!important}}
/* The back action is now in the chat header, matching the supplied Telegram-style screenshot. */
.composer .chatBackComposerBtn{display:none!important;visibility:hidden!important;pointer-events:none!important}

/* Telegram-like mobile chat mode: keep the global identity bar, show only the active chat, and keep its header visible. */
@media(max-width:800px){
  .appPage.chatMode .pageHeading{display:none}
  .appPage.chatMode .layout{display:block;min-height:calc(100vh - 74px);height:calc(100vh - 74px)}
  .appPage.chatMode .sidebar{display:none}
  .appPage.chatMode .chat{display:flex;min-height:calc(100vh - 74px);height:calc(100vh - 74px)}
  .appPage.chatMode .chatHeader{flex:0 0 auto;z-index:5}
  .appPage.chatMode .messages{flex:1;min-height:0}
}

/* FINAL iPhone composer visibility fix: keep the message input above the home indicator. */
@media (max-width:800px){
  .appPage.chatMode .chat{
    height:calc(100dvh - 74px)!important;
    min-height:0!important;
    overflow:hidden;
  }
  .appPage.chatMode .messages{
    min-height:0!important;
    padding-bottom:110px!important;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  .appPage.chatMode .composer{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    z-index:50!important;
    width:100%!important;
    margin:0!important;
    box-sizing:border-box!important;
    padding:8px 10px calc(8px + env(safe-area-inset-bottom))!important;
    background:rgba(255,255,255,.98)!important;
    border-top:1px solid #ddd!important;
    box-shadow:0 -4px 16px rgba(0,0,0,.05)!important;
  }
  .appPage.chatMode .composer input{
    min-width:0!important;
  }
}

/* ---------- Karmadonov Premium + original gift collection ---------- */
.premiumHeroCard{position:relative;margin-top:18px;border-radius:28px;background:#111;color:#fff;padding:24px 24px 22px;display:grid;grid-template-columns:74px 1fr;gap:16px;align-items:center;overflow:hidden;box-shadow:0 14px 34px rgba(0,0,0,.14)}
.premiumHeroCard:after{content:"";position:absolute;width:180px;height:180px;border:1px solid rgba(255,255,255,.12);border-radius:50%;right:-55px;top:-80px;box-shadow:0 0 0 22px rgba(255,255,255,.035),0 0 0 44px rgba(255,255,255,.025)}
.premiumHeroIcon{width:74px;height:74px;border-radius:24px;background:#fff;color:#111;display:flex;align-items:center;justify-content:center;font-size:38px;font-weight:900;position:relative;z-index:1}
.premiumHeroText{position:relative;z-index:1}.premiumEyebrow{font-size:11px;letter-spacing:.18em;font-weight:800;opacity:.58}.premiumHeroText h2{font-size:27px;margin:4px 0 5px}.premiumHeroText p{margin:0;color:#c9c9c9;line-height:1.4;font-size:14px;max-width:520px}.premiumStatus{grid-column:2;justify-self:start;margin-top:-3px;border:1px solid #444;border-radius:999px;padding:7px 12px;color:#fff;font-size:12px;font-weight:800;position:relative;z-index:1}
.premiumPlansCard,.premiumGiftsCard{margin-top:18px;border:1px solid #ddd;border-radius:24px;background:#fff;padding:20px}.premiumSectionHeader h2{margin:0 0 5px;font-size:22px}.premiumSectionHeader p{margin:0;line-height:1.4}.premiumPlans{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:16px}.premiumPlan{position:relative;border:1px solid #ddd;border-radius:20px;background:#fafafa;padding:17px;min-width:0}.premiumPlan.featured{background:#111;color:#fff;border-color:#111;box-shadow:0 10px 24px rgba(0,0,0,.14)}.premiumPlanBadge{position:absolute;right:12px;top:10px;font-size:9px;font-weight:900;letter-spacing:.08em;background:#fff;color:#111;border-radius:999px;padding:5px 8px}.premiumPlanTop{display:flex;align-items:center;gap:8px}.premiumPlanIcon{width:32px;height:32px;border-radius:11px;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900}.premiumPlan.featured .premiumPlanIcon{background:#fff;color:#111}.premiumPlanNote{font-size:11px;color:#777}.premiumPlan.featured .premiumPlanNote{color:#bbb}.premiumPlan h3{font-size:20px;margin:14px 0 7px}.premiumPlanPrice{font-size:30px;font-weight:900;line-height:1}.premiumPlanPrice span{font-size:16px;margin-left:5px}.premiumBuyBtn{width:100%;margin-top:15px;padding:12px 10px;border-radius:13px}.premiumPlan.featured .premiumBuyBtn{background:#fff;color:#111}.premiumBuyBtn:disabled{opacity:.5;cursor:default}
.premiumGiftGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:16px}.premiumGift{border:1px solid #ddd;border-radius:22px;background:#fafafa;padding:14px;min-width:0}.premiumGiftArt{height:126px;border-radius:18px;background:#111;color:#fff;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden}.premiumGiftArt:before,.premiumGiftArt:after{content:"";position:absolute;border-radius:50%;border:1px solid rgba(255,255,255,.18)}.premiumGiftArt:before{width:100px;height:100px}.premiumGiftArt:after{width:145px;height:145px}.premiumGiftArt span{font-size:62px;position:relative;z-index:1;filter:drop-shadow(0 8px 12px rgba(0,0,0,.35))}.premiumGiftArt i{position:absolute;right:10px;top:8px;font-style:normal;font-size:18px;color:#fff;opacity:.8}.premiumGiftName{font-weight:900;font-size:16px;margin-top:12px}.premiumGiftNote{font-size:12px;color:#777;margin-top:3px;min-height:30px}.premiumGiftBottom{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px}.premiumGiftBottom strong{font-size:15px;white-space:nowrap}.giftSendBtn{padding:9px 11px!important;border-radius:12px!important;font-weight:800}.premiumGiftsCard .coffeeMessage{margin-bottom:0}
@media(max-width:800px){.premiumHeroCard{grid-template-columns:58px 1fr;padding:18px}.premiumHeroIcon{width:58px;height:58px;border-radius:19px;font-size:29px}.premiumHeroText h2{font-size:22px}.premiumHeroText p{font-size:13px}.premiumStatus{grid-column:1 / -1;margin-top:0}.premiumPlans{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:4px}.premiumPlan{min-width:220px;scroll-snap-align:start}.premiumGiftGrid{grid-template-columns:repeat(2,1fr)}.premiumGiftArt{height:112px}.premiumGiftArt span{font-size:52px}.premiumGiftName{font-size:14px}.premiumGiftNote{font-size:11px}.premiumGiftBottom{align-items:stretch;flex-direction:column}.giftSendBtn{width:100%}}
@media(max-width:430px){.premiumPlansCard,.premiumGiftsCard{padding:16px}.premiumGiftGrid{gap:9px}.premiumGift{padding:10px;border-radius:18px}.premiumGiftArt{height:100px}.premiumGiftArt span{font-size:46px}}

/* Karmadonov gifts + profile inventory */
.giftRecipientLabel{margin:18px 0 8px!important;font-size:14px!important}
.giftRecipient{width:100%;box-sizing:border-box;border:1px solid #ddd;border-radius:15px;background:#fff;padding:14px 15px;font-size:16px;color:#111;min-height:50px}
.premiumGiftPrice{margin-top:10px;font-weight:900;font-size:16px}
.premiumGiftBottom{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.premiumGiftBottom button{width:100%;padding:10px 8px!important;border-radius:12px!important;font-weight:800}
.profileGiftsSection{margin-top:22px;border:1px solid #e1e1e1;border-radius:20px;padding:16px;text-align:left;background:#fafafa}
.profileGiftsHeader{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.profileGiftsHeader h3{margin:0;font-size:19px}
.profileGiftsCount{font-size:13px;color:#777;font-weight:700}
.profileGiftsList{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.profileGiftItem{display:flex;align-items:center;gap:9px;border:1px solid #e2e2e2;border-radius:15px;background:#fff;padding:9px;min-width:0}
.profileGiftArt{width:46px;height:46px;flex:0 0 46px;border-radius:13px;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;font-size:27px}
.profileGiftInfo{display:flex;flex-direction:column;min-width:0;gap:2px}
.profileGiftInfo strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profileGiftInfo span,.profileGiftInfo small{font-size:10px;color:#777;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profileNoGifts{padding:8px 0}
/* Keep the back arrow immediately left of the paperclip and make it reliably clickable on iPhone/Safari. */
.appPage.chatMode .composer.chatOpen .chatBackComposerBtn{display:inline-flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;position:relative;z-index:4;transform:none!important}
.appPage.chatMode .composer.chatOpen .chatBackComposerBtn:active{transform:scale(.94)!important}
@media(max-width:800px){.premiumGiftBottom{grid-template-columns:1fr}.profileGiftsList{grid-template-columns:1fr}.profileGiftsSection{padding:14px}}

/* Karmadonov communities */
.communityCreateRow{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:18px 0 8px;padding:0 2px}
.communityCreateLabel{font-weight:800;font-size:18px}
.communityPlusBtn{width:42px;height:42px;border:1px solid #ddd;border-radius:50%;background:#fff;color:#111;font-size:28px;line-height:1;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.06)}
.communityPlusBtn:active{transform:scale(.96)}
.communitiesList{margin-bottom:18px}
.communityItem{display:flex;align-items:center;gap:12px;width:100%;padding:12px;border:1px solid #ddd;border-radius:18px;background:#fff;margin:8px 0;cursor:pointer;text-align:left}
.communityItem:hover{background:#fafafa}
.communityItem .communityAvatarSmall{width:48px;height:48px;border-radius:50%;object-fit:cover;display:grid;place-items:center;background:#111;color:#fff;font-weight:800;flex:0 0 auto}
.communityItem .communityAvatarSmall.placeholder{font-size:20px}
.communityItemText{min-width:0;flex:1}
.communityItemText strong{display:block;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.communityItemText span{display:block;color:#777;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:3px}
.communityBadge{font-size:12px;padding:5px 8px;border-radius:999px;background:#f0f0f0;color:#555;flex:0 0 auto}
.communityCard{width:min(680px,calc(100vw - 28px));max-height:min(90vh,900px);overflow:auto;background:#fff;border-radius:24px;padding:24px;position:relative;box-shadow:0 18px 70px rgba(0,0,0,.22)}
.communityCard h2{margin:4px 0 8px;font-size:28px}
.communityTypeSwitch{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:18px 0}
.communityTypeBtn{border:1px solid #ddd;background:#f5f5f5;border-radius:14px;padding:12px;font-weight:700;font-size:16px;cursor:pointer}
.communityTypeBtn.active{background:#111;color:#fff;border-color:#111}
.communityAvatarEditor{display:flex;align-items:center;gap:16px;margin:8px 0 16px}
.communityAvatarPreview{width:76px;height:76px;border-radius:50%;display:grid;place-items:center;background:#111;color:#fff;font-size:28px;font-weight:700;overflow:hidden;flex:0 0 auto}
.communityAvatarPreview img{width:100%;height:100%;object-fit:cover}
.communityInviteTitle{font-size:18px;font-weight:800;margin:18px 0 8px}
.communityInviteList{max-height:220px;overflow:auto;border:1px solid #ddd;border-radius:16px;padding:8px}
.communityInviteRow{display:flex;align-items:center;gap:10px;padding:9px;border-radius:12px}
.communityInviteRow:hover{background:#f6f6f6}
.communityInviteRow input{width:20px;height:20px;flex:0 0 auto}
.communityInviteRow .avatar{width:40px;height:40px;border-radius:50%;object-fit:cover;display:grid;place-items:center;background:#111;color:#fff}
.communityInviteInfo{min-width:0}
.communityInviteInfo strong{display:block}
.communityInviteInfo span{display:block;color:#777;font-size:13px}
.communityCreateConfirmBtn{width:100%;margin-top:12px}
.chatCommunityTitle{font-weight:800}
.chatCommunityMeta{display:block}
.chatHeader .chatHeaderInfo{min-width:0}
.chatHeader .chatHeaderInfo strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chatHeader .chatHeaderInfo span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.communityHeaderAvatar{width:46px;height:46px;border-radius:50%;object-fit:cover;display:grid;place-items:center;background:#111;color:#fff;font-weight:800}
.communityInviteBtn{border:1px solid #ddd;background:#fff;border-radius:50%;width:44px;height:44px;font-size:20px;cursor:pointer}
.communityJoinHint{margin:8px 0 14px;color:#777;font-size:13px}
.messageMediaImage,.messageMediaVideo{display:block;max-width:min(420px,75vw);max-height:420px;border-radius:14px;object-fit:contain;margin-top:5px;background:#eee}
.messageMediaVideo{width:min(420px,75vw)}
.communitySearchResult{margin-top:8px}
@media(max-width:800px){
  .communityCard{padding:18px;border-radius:20px}
  .communityInviteList{max-height:190px}
}

/* Karmadonov verified creator badge */
.verifiedName{display:inline-flex;align-items:center;gap:6px;min-width:0}
.verifiedCheck{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  flex:0 0 18px;
  border-radius:50%;
  background:#111 !important;
  color:#fff !important;
  font-size:12px;
  font-weight:900;
  line-height:18px;
  text-align:center;
  vertical-align:middle;
  padding:0;
  margin:0;
}
.verifiedNameText{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.communityItemText .verifiedNameText{display:inline;overflow:visible;text-overflow:clip}
.chatCommunityTitle .verifiedCheck{width:17px;height:17px;flex-basis:17px;font-size:11px}

/* Verified badge final alignment override */
.verifiedCheck{display:inline-flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;background:#111!important;color:#fff!important;}

.communityCard{position:relative}.modalBack{position:absolute;left:16px;top:14px;border:0;background:#eee;border-radius:50%;width:38px;height:38px;font-size:25px;line-height:38px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.modalBack.hidden{display:none!important}.communityCard h2{text-align:center}


/* KAI + multi-account */
#kaiPage{height:calc(100vh - 150px);min-height:520px}
.kaiPageInner{height:100%;display:flex;flex-direction:column;min-height:0;background:#fff}
.kaiHeader{height:72px;flex:0 0 72px;border-bottom:1px solid #e4e4e4;display:flex;align-items:center;gap:12px;padding:0 18px;box-sizing:border-box}
.kaiBackBtn{width:44px;height:44px;border:1px solid #ddd;border-radius:50%;background:#fff;font-size:36px;line-height:38px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.kaiAvatar{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:#111;color:#fff;font-size:25px;box-shadow:0 4px 14px rgba(0,0,0,.12)}
.kaiHeaderText{display:flex;flex-direction:column;min-width:0}.kaiHeaderText strong{font-size:21px}.kaiHeaderText span{font-size:13px;margin-top:2px}
.kaiMessages{flex:1;min-height:0;overflow:auto;padding:18px 16px 22px;display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth}
.kaiBubble{max-width:min(760px,82%);padding:13px 16px;border-radius:20px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:16px;line-height:1.45}
.kaiBubble.user{align-self:flex-end;background:#111;color:#fff;border-bottom-right-radius:7px}.kaiBubble.assistant{align-self:flex-start;background:#f1f1f1;color:#111;border-bottom-left-radius:7px}
.kaiBubble .kaiTime{display:block;font-size:11px;opacity:.55;margin-top:5px}
.kaiBubble img{max-width:100%;max-height:320px;border-radius:14px;display:block;margin-bottom:8px}
.kaiTyping{opacity:.65;font-style:italic}
.kaiComposer{position:sticky;bottom:0;display:flex;align-items:center;gap:9px;padding:10px 14px calc(10px + env(safe-area-inset-bottom));background:rgba(255,255,255,.97);border-top:1px solid #e5e5e5;z-index:5}
.kaiAttachBtn{width:48px;height:48px;flex:0 0 48px;border:1px solid #ddd;border-radius:50%;background:#fff;font-size:23px;cursor:pointer}.kaiComposer input{flex:1;min-width:0;height:48px;border:1px solid #ddd;border-radius:24px;padding:0 17px;font-size:16px;box-sizing:border-box;outline:none}.kaiComposer input:focus{border-color:#111}.kaiSendBtn{width:48px;height:48px;flex:0 0 48px;border-radius:50%;padding:0!important;font-size:21px}
.accountsCard{width:min(520px,calc(100vw - 28px));max-height:min(82vh,720px);overflow:auto;background:#fff;border-radius:24px;padding:24px;position:relative;box-shadow:0 18px 70px rgba(0,0,0,.22);box-sizing:border-box}.accountsCard h2{margin:4px 0 8px;font-size:28px}.accountsList{display:flex;flex-direction:column;gap:9px;margin:18px 0}.accountRow{display:flex;align-items:center;gap:12px;width:100%;border:1px solid #ddd;border-radius:17px;background:#fff;padding:10px 12px;box-sizing:border-box;text-align:left;cursor:pointer}.accountRow.current{border-color:#111;background:#f7f7f7}.accountRow .accountAvatar{width:48px;height:48px;border-radius:50%;object-fit:cover;display:grid;place-items:center;background:#111;color:#fff;font-weight:800;flex:0 0 48px}.accountRowText{min-width:0;flex:1}.accountRowText strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.accountRowText span{display:block;color:#777;font-size:13px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.accountCurrent{font-size:12px;color:#111;font-weight:800}.accountsAddBtn{width:100%}
@media(max-width:800px){#kaiPage{height:calc(100vh - 128px);min-height:0}.kaiBubble{max-width:88%}.kaiHeader{padding:0 12px}.kaiComposer{padding-left:10px;padding-right:10px}.accountsCard{padding:18px;border-radius:20px}}
.contactHint{font-size:12px;line-height:1.35;margin:8px 2px 10px;}

.voiceBtn{border:1px solid #ddd;background:#fff;border-radius:12px;min-width:42px;height:42px;cursor:pointer;font-size:18px}.voiceBtn:disabled{opacity:.45;cursor:not-allowed}.voiceBtn.recording{background:#111;color:#fff;animation:karmadonovPulse 1s infinite}.messageVoiceAudio{width:min(280px,100%);height:42px}.profileGiftsMoreBtn{margin-top:10px;width:100%}.profileGiftsAll{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:9px}.profileGiftsAll.hidden{display:none}@keyframes karmadonovPulse{50%{transform:scale(1.05)}}

/* Unread message counter: compact black circle at the far right of each chat. */
.unreadSlot{margin-left:auto;flex:0 0 auto;min-width:24px;display:inline-flex;align-items:center;justify-content:center}
.unreadBadge{width:24px;height:24px;min-width:24px;border-radius:50%;background:#111;color:#fff;display:inline-flex;align-items:center;justify-content:center;text-align:center;font-size:12px;font-weight:800;line-height:1;padding:0;box-shadow:0 1px 2px rgba(0,0,0,.12)}
@media(max-width:800px){.unreadBadge{width:23px;height:23px;min-width:23px;font-size:11px}.unreadSlot{min-width:23px}}

.profileGiftExchangeBtn{margin-top:4px;width:100%;padding:6px 8px!important;border-radius:9px!important;font-size:10px;font-weight:800}
.profileGiftExchangeBtn:disabled{opacity:.55;cursor:default}
.profileGiftExchanged{font-size:10px;color:#333;font-weight:800}

.giftExchangeCard{width:min(440px,calc(100vw - 28px));background:#fff;border-radius:28px;padding:28px;position:relative;text-align:center;box-shadow:0 25px 80px rgba(0,0,0,.25)}
.giftExchangeArt{width:82px;height:82px;border-radius:24px;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;font-size:48px;margin:4px auto 14px}
.giftExchangeCard h2{margin:0;font-size:25px}.giftExchangeName{margin:5px 0 20px;color:#777;font-weight:700}
.giftExchangeRows{border:1px solid #e5e5e5;border-radius:18px;overflow:hidden;text-align:left}.giftExchangeRows>div{display:flex;justify-content:space-between;gap:14px;padding:13px 15px;border-bottom:1px solid #eee}.giftExchangeRows>div:last-child{border-bottom:0}.giftExchangeRows span{color:#777}.giftExchangeRows strong{white-space:nowrap}.giftExchangeTotal{background:#f7f7f7;font-size:17px}.giftExchangeTotal strong{font-size:20px}.giftExchangeStatus{min-height:20px;color:#777;font-size:13px}.giftExchangeConfirmBtn{width:100%;margin-top:4px}.giftExchangeConfirmBtn:disabled{opacity:.55}.profileGiftItem[data-exchangeable="1"]{cursor:pointer}.profileGiftItem[data-exchangeable="1"]:active{transform:scale(.985)}

.smallLink{font-size:.9rem;opacity:.9}

/* KARMADONOV ARCADE */
.gameCard{width:min(940px,calc(100vw - 24px));max-height:92vh;overflow:auto;background:#fff;border-radius:28px;padding:24px;position:relative;box-shadow:0 25px 90px rgba(0,0,0,.28);box-sizing:border-box}
.gameHeader{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-right:38px}.gameKicker{font-size:11px;font-weight:900;letter-spacing:.14em;opacity:.5}.gameCard h2{margin:3px 0 0;font-size:30px}.gameBest{font-size:13px;font-weight:800;color:#666;padding-top:9px;text-align:right}.gameLevelSelect{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:18px 0 10px}.gameLevelBtn{border:1px solid #ddd;background:#f7f7f7;border-radius:16px;padding:12px 10px;text-align:left;cursor:pointer;transition:.15s}.gameLevelBtn strong{display:block;font-size:15px}.gameLevelBtn span{display:block;margin-top:3px;color:#777;font-size:12px}.gameLevelBtn.active{background:#111;color:#fff;border-color:#111;transform:translateY(-1px)}.gameLevelBtn.active span{color:#ddd}.gameStatus{min-height:22px;color:#666;font-size:13px;margin:8px 2px 10px}.gameLaunchBar{display:flex;align-items:center;gap:10px;margin:8px 0 10px}.gameLaunchHint{font-size:12px;color:#888}.gameCanvasWrap{position:relative;width:100%;aspect-ratio:960/480;min-height:280px;overflow:hidden;border-radius:20px;background:linear-gradient(135deg,#edf3ff,#fff);border:1px solid #d9d9d9;touch-action:none}.gameCanvas{position:absolute;inset:0;display:block;width:100%!important;height:100%!important;max-width:none;touch-action:none;z-index:2}.gameFallback{position:absolute;inset:0;z-index:1;overflow:hidden;background:linear-gradient(180deg,#edf3ff 0%,#dce7ff 72%,#111827 72%,#111827 100%);font-weight:900}.gameFallbackTitle{position:absolute;left:20px;top:18px;font-size:12px;letter-spacing:.12em;opacity:.55}.gameFallbackCeiling{position:absolute;left:0;right:0;top:7%;height:4px;background:#4f6cff}.gameFallbackPlayer{position:absolute;left:16%;bottom:27%;width:38px;height:38px;border-radius:8px;background:#4f6cff;color:#fff;display:flex;align-items:center;justify-content:center;font-size:22px;box-shadow:0 8px 20px rgba(0,0,0,.18)}.gameFallbackSpike{position:absolute;color:#4f6cff;font-size:42px;line-height:1}.gameFallbackSpike.s1{left:35%;bottom:26%}.gameFallbackSpike.s2{left:53%;bottom:26%}.gameFallbackSpike.s3{right:14%;top:14%;transform:rotate(180deg)}.gameFallbackSaw{position:absolute;left:64%;top:43%;font-size:48px;color:#4f6cff}.gameFallbackBlock{position:absolute;background:#111827;border:2px solid #4f6cff;border-radius:4px;bottom:0}.gameFallbackBlock.b1{left:43%;height:25%;width:8%}.gameFallbackBlock.b2{right:7%;height:34%;width:10%}.gameFallbackModes{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;gap:8px;flex-wrap:wrap;justify-content:center;width:80%;font-size:13px;color:#111;background:rgba(255,255,255,.82);padding:12px 14px;border-radius:16px;box-shadow:0 8px 30px rgba(0,0,0,.12)}.gameFallbackModes span{white-space:nowrap}.gameStartBtn{position:relative;z-index:4;border:0;background:#111;color:#fff;border-radius:999px;padding:11px 18px;font-size:15px;font-weight:900;cursor:pointer;box-shadow:0 8px 24px rgba(0,0,0,.14)}.gameStartBtn:disabled{opacity:.65}.gameControls{display:flex;justify-content:space-between;gap:10px;margin-top:10px;color:#777;font-size:12px}.gameControls span:last-child{font-weight:900;color:#111}@media(max-width:650px){.gameLaunchHint{display:none}.gameCard{padding:16px;border-radius:22px}.gameHeader{display:block}.gameBest{text-align:left;padding-top:6px}.gameLevelSelect{grid-template-columns:1fr}.gameLevelBtn{padding:10px}.gameCard h2{font-size:26px}}

/* V6 startup/navigation hardening: bottom navigation is never visible during the KARMADONOV splash. */
body.kmBooting .bottomNav{display:none!important} body.kmBooting #messengerView{visibility:hidden!important} body.kmReady #messengerView{visibility:visible!important}
body.kmBooting #messengerView{visibility:hidden!important}
body.kmReady #messengerView{visibility:visible!important}
/* Easier arcade hitboxes: the visual obstacles remain intact, collision boxes are forgiving. */
.gameCanvasWrap{user-select:none;-webkit-user-select:none;}

.adminCard{text-align:left;width:min(760px,100%);padding:26px;max-height:88vh;overflow:auto}.adminCard h2{text-align:center}.adminHint{text-align:center;margin:0 0 18px}.adminSearchForm{display:flex;gap:10px;margin:12px 0 18px}.adminSearchForm input{flex:1;min-width:0;border:1px solid #ddd;border-radius:14px;padding:13px 14px;font-size:16px}.adminSearchForm button{border:0;border-radius:14px;padding:0 18px}.adminStats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:16px}.adminStat{border:1px solid #e5e5e5;border-radius:16px;padding:13px;background:#fafafa}.adminStat strong{display:block;font-size:20px}.adminStat span{color:#777;font-size:12px}.adminUser{border:1px solid #e5e5e5;border-radius:16px;padding:14px;margin:9px 0;background:#fff}.adminUserTop{display:flex;justify-content:space-between;gap:12px;align-items:center}.adminUserName{font-weight:800}.adminUserMeta{color:#777;font-size:13px;line-height:1.5;margin-top:7px}.adminBadge{font-size:11px;border-radius:999px;padding:4px 8px;background:#eee;color:#555}.adminEmpty{padding:18px;text-align:center}.adminDanger{color:#a00000}@media(max-width:560px){.adminStats{grid-template-columns:1fr 1fr}.adminSearchForm{flex-direction:column}.adminSearchForm button{min-height:46px}}

.messageContextMenu{position:fixed;z-index:99999;min-width:205px;max-width:260px;padding:8px;border:1px solid rgba(0,0,0,.12);border-radius:16px;background:rgba(255,255,255,.98);box-shadow:0 14px 40px rgba(0,0,0,.2);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.messageContextAction{display:block;width:100%;border:0;border-radius:11px;background:transparent;color:#111;text-align:left;padding:10px 11px;font-size:14px;font-weight:650;cursor:pointer}.messageContextAction:active{background:#eee}.messageContextAction.danger{color:#c62828}.messageContextTitle{font-size:11px;font-weight:700;color:#777;padding:7px 8px 5px}.messageContextReactions{display:flex;gap:4px;flex-wrap:wrap;padding:2px 3px 4px}.messageContextReaction{width:35px;height:35px;border:0;border-radius:10px;background:#f1f1f1;font-size:19px;cursor:pointer}.messageContextReaction:active{transform:scale(.92);background:#ddd}.bubble{-webkit-touch-callout:none;user-select:none}.bubble .body{user-select:text;-webkit-user-select:text}

/* V23 message replies: Telegram-style quote + swipe-left reply. */
.replyComposer{display:flex;align-items:center;gap:10px;margin:0 16px;padding:9px 10px;border:1px solid #e2e2e2;border-radius:14px;background:#f7f7f7;min-height:52px;overflow:hidden}.replyComposer.hidden{display:none!important}.replyComposerAccent{width:4px;align-self:stretch;min-height:34px;border-radius:99px;background:#111}.replyComposerContent{display:flex;flex-direction:column;min-width:0;flex:1}.replyComposerContent strong{font-size:12px;line-height:16px}.replyComposerContent span{font-size:13px;color:#666;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.replyComposerClose{width:34px;height:34px;border:0;border-radius:50%;background:#e9e9e9;color:#111;font-size:22px;line-height:1;cursor:pointer}.messageReplyQuote{display:flex;flex-direction:column;gap:2px;width:100%;margin:0 0 7px;padding:7px 9px;border:0;border-left:4px solid rgba(255,255,255,.72);border-radius:7px;background:rgba(255,255,255,.12);color:inherit;text-align:left;cursor:pointer}.theirs .messageReplyQuote{border-left-color:#111;background:rgba(0,0,0,.06)}.messageReplyQuote strong{font-size:11px}.messageReplyQuote span{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bubble{touch-action:pan-y;transition:box-shadow .15s,transform .15s}.bubble.replyHighlight{box-shadow:0 0 0 3px rgba(0,0,0,.18);transform:scale(1.01)}
@media(max-width:800px){.replyComposer{margin:0 10px}.messageReplyQuote{max-width:100%}}

/* Karmadonov V24 media viewer / iPhone save sheet */
.mediaViewer{position:fixed;inset:0;z-index:30000;background:rgba(0,0,0,.94);display:flex;align-items:center;justify-content:center;padding:18px;box-sizing:border-box}
.mediaViewer.hidden{display:none!important}
.mediaViewerPanel{position:relative;width:min(94vw,760px);height:min(92vh,900px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;color:#fff}
.mediaViewerContent{display:block;max-width:100%;max-height:calc(100% - 100px);width:auto;height:auto;object-fit:contain;border-radius:12px;background:#111}
.mediaViewerContent[src]{min-width:40px;min-height:40px}
.mediaViewerClose{position:absolute;right:0;top:0;width:44px;height:44px;border:0;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;font-size:30px;line-height:44px;z-index:2}
.mediaViewerTitle{font-size:17px;font-weight:700;opacity:.9}
.mediaViewerSave{border:0;border-radius:14px;padding:12px 24px;background:#fff;color:#111;font-size:17px;font-weight:700;min-width:150px}
.messageMediaImage,.messageMediaVideo{cursor:pointer}

/* Karmadonov Premium v26 */
.premiumBadge{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;margin:0 5px 0 4px;border-radius:50%;background:#090909;color:#fff;font-size:14px;line-height:1;font-weight:900;vertical-align:-4px;box-shadow:0 0 0 2px rgba(0,0,0,.10),0 2px 6px rgba(0,0,0,.16)}
.premiumAvatar{box-shadow:none!important;outline:none!important;}
.premiumFeaturesCard{margin-top:18px;border:1px solid #ddd;border-radius:24px;background:#fff;padding:20px}
.premiumFeatures{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px}
.premiumFeature{display:flex;gap:12px;align-items:flex-start;border:1px solid #e5e5e5;border-radius:18px;padding:13px;background:#fafafa}
.premiumFeatureIcon{width:40px;height:40px;flex:0 0 40px;border-radius:13px;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;font-size:19px}
.premiumFeature strong{display:block;font-size:14px;line-height:1.25}
.premiumFeature p{margin:4px 0 0;color:#777;font-size:12px;line-height:1.4}
@media(max-width:700px){.premiumFeatures{grid-template-columns:1fr}.premiumFeaturesCard{padding:16px}.premiumFeature{padding:12px}}

/* Direct-chat pinning */
.user.pinnedChat{
  position:relative;
  border-color:#111;
  background:#f7f7f7;
  box-shadow:0 2px 10px rgba(0,0,0,.06);
}
.user.pinnedChat::before{
  content:"";
  position:absolute;
  left:-1px;
  top:10px;
  bottom:10px;
  width:4px;
  border-radius:4px;
  background:#111;
}
.chatPinBtn{
  width:38px;height:38px;flex:0 0 38px;
  border:1px solid #ddd;border-radius:50%;
  background:#fff;color:#555;
  display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;font-size:21px;line-height:1;
  transition:background .15s,border-color .15s,transform .15s;
}
.chatPinBtn:hover{background:#f1f1f1;border-color:#aaa}
.chatPinBtn:active{transform:scale(.92)}
.chatPinBtn.isPinned{background:#111;color:#fff;border-color:#111;font-size:18px}
.chatPinBtn:focus-visible{outline:2px solid #111;outline-offset:2px}

/* Karmadonov voice/video calling */
.chatCallActions{display:flex;align-items:center;gap:7px;margin-left:auto;flex:0 0 auto}
.chatCallBtn{width:40px;height:40px;flex:0 0 40px;border:1px solid #ddd;border-radius:50%;background:#fff;color:#111;display:inline-flex;align-items:center;justify-content:center;font-size:19px;cursor:pointer;box-shadow:0 3px 10px rgba(0,0,0,.05);transition:transform .15s,background .15s}
.chatCallBtn:active{transform:scale(.93)}.chatCallBtn:hover{background:#f2f2f2}
.chatHeader .chatHeaderInfo{flex:1;min-width:0}
.callModal{position:fixed;inset:0;z-index:10000;background:rgba(10,10,10,.68);display:flex;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(10px)}
.callCard{width:min(440px,100%);min-height:370px;border-radius:30px;background:linear-gradient(155deg,#fff,#f1f1f1);box-shadow:0 30px 100px rgba(0,0,0,.35);padding:30px 22px 26px;text-align:center;position:relative;overflow:hidden}
.callAvatar{width:100px;height:100px;border-radius:50%;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;font-size:38px;font-weight:800;margin:12px auto 18px;box-shadow:0 8px 28px rgba(0,0,0,.16)}
.callKicker{font-size:10px;font-weight:800;letter-spacing:2px;color:#777}.callCard h2{font-size:25px;margin:8px 0}.callCard p{margin:8px 0 22px}
.callActions{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:26px}.callActionBtn,.callAcceptBtn,.callHangupBtn{width:58px;height:58px;border:0;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:23px;cursor:pointer;box-shadow:0 5px 15px rgba(0,0,0,.12)}
.callActionBtn{background:#e9e9e9;color:#111}.callAcceptBtn{background:#15803d;color:white}.callHangupBtn{background:#d92332;color:white;font-size:22px}
.callRemoteWrap{position:relative;width:100%;aspect-ratio:4/3;border-radius:18px;overflow:hidden;background:#111;margin:16px 0}.callRemoteWrap video{width:100%;height:100%;object-fit:cover}.callLocalVideo{position:absolute;right:18px;bottom:92px;width:94px;height:132px;object-fit:cover;border-radius:14px;background:#222;border:2px solid white;box-shadow:0 5px 20px #0003}
@media(max-width:800px){.chatCallActions{gap:5px}.chatCallBtn{width:36px;height:36px;flex-basis:36px;font-size:17px}.callCard{border-radius:26px;padding:24px 18px}.callAvatar{width:88px;height:88px}}

/* Karmadonov V32: restore comfortable, consistent contact row sizing */
#usersList .user{min-height:86px;box-sizing:border-box;padding:14px 16px;gap:12px;border-radius:22px;}
#usersList .userAvatar{width:54px;height:54px;min-width:54px;min-height:54px;box-sizing:border-box;outline:none!important;box-shadow:none!important;}
#usersList .avatarButton{width:54px;height:54px;min-width:54px;flex:0 0 54px;}
#usersList .userMain{min-width:0;}
#usersList .userMain strong{line-height:1.25;}
#usersList .user.pinnedChat{padding-left:18px;}
#usersList .user.pinnedChat::before{left:0;top:12px;bottom:12px;width:4px;}
.kaiMediaPreview{max-width:min(260px,70vw);max-height:220px;border-radius:14px;display:block;margin-bottom:6px;object-fit:contain;background:#f4f4f4;}
.kaiVoiceStatus{font-size:12px;color:#666;min-width:42px;text-align:center;}
.kaiAttachBtn:disabled{opacity:.5;}
@media(max-width:700px){#usersList .user{min-height:88px;padding:14px 12px;gap:10px;}#usersList .userAvatar,#usersList .avatarButton{width:52px;height:52px;min-width:52px;min-height:52px;flex-basis:52px;}#usersList .userMain strong{font-size:17px;} }

/* Keep chat list scroll and taps responsive on mobile Safari */
#usersList .user{contain:layout style;transition:background-color .14s ease,border-color .14s ease;}
#usersList .user:active{transform:none;}
.kaiMessages{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}


/* Karmadonov V33: smaller consistent chat rows */
#usersList .user{min-height:76px!important;padding:10px 12px!important;gap:10px!important;border-radius:19px!important;margin-bottom:8px!important;}
#usersList .userAvatar,#usersList .avatarButton{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;flex:0 0 44px!important;}
#usersList .userMain strong{font-size:16px!important;line-height:1.2!important;}
#usersList .userMain .muted{font-size:13px!important;line-height:1.25!important;}
#usersList .chatPinBtn,#usersList .chatDeleteBtn{width:34px!important;height:34px!important;min-width:34px!important;flex:0 0 34px!important;font-size:17px!important;}
#usersList .user.pinnedChat{padding-left:15px!important;}
@media(max-width:700px){#usersList .user{min-height:72px!important;padding:9px 10px!important;gap:8px!important;}#usersList .userAvatar,#usersList .avatarButton{width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;flex-basis:42px!important;}#usersList .userMain strong{font-size:15px!important;}#usersList .userMain .muted{font-size:12px!important;}#usersList .chatPinBtn,#usersList .chatDeleteBtn{width:31px!important;height:31px!important;min-width:31px!important;flex-basis:31px!important;}}

/* Gentle custom line-art doodles behind chat messages (original Karmadonov pattern). */
.appPage.chatMode .messages{position:relative;isolation:isolate;background-color:#faf9fd;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='190' viewBox='0 0 190 190'%3E%3Cg fill='none' stroke='%239a87b9' stroke-opacity='.16' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 25c-8-10-20 2-9 12l9 9 9-9c11-10-1-22-9-12zM117 19l7 14 15 2-11 10 3 15-14-8-13 8 3-15-11-10 15-2zM34 107c0-10 15-10 15 0v15H34zM29 122h25M37 107v-8h10v8M83 77c7-8 18-5 19 4l-3 14H80l-3-14c0-3 2-5 6-6zM82 95l-8 8M99 95l8 8M77 112l-5 6M102 112l5 6M139 92c8-8 18-1 13 8l-12 17-12-17c-5-9 3-16 11-8zM155 145c-8-7-17 2-10 10l10 10 10-10c7-8-2-17-10-10zM26 159l15-7 15 7-15 8zM123 145l6-11 6 11-6 10zM65 26l4 8 9 1-7 6 2 9-8-5-8 5 2-9-7-6 9-1zM90 151c-8-8-20 0-13 9l13 13 13-13c7-9-5-17-13-9z'/%3E%3Ccircle cx='157' cy='42' r='8'/%3E%3Cpath d='M153 42h8M157 38v8M18 75l7-8 7 8-7 8zM169 103l-6 12h8l-4 10 13-15h-8l4-7zM61 135c7-7 13 1 8 7l-8 8-8-8c-5-6 1-14 8-7z'/%3E%3C/g%3E%3C/svg%3E");background-size:190px 190px;}
.appPage.chatMode .messages::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(180deg,rgba(255,255,255,.22),rgba(255,255,255,.08));}

/* Theme picker */
.themeCard{width:min(420px,100%);padding:28px 22px 22px;background:#fff;color:#111;border-radius:28px;box-shadow:0 24px 80px #0003;position:relative;}
.themeCard h2{margin:0 34px 8px 0;font-size:25px}.themeCard>p{margin:0 0 20px}.themeChoice{width:100%;display:flex;align-items:center;gap:13px;padding:12px;margin:8px 0;border:1px solid #dedee3;border-radius:18px;background:#fff;color:#111;text-align:left;cursor:pointer}.themeChoice>span:nth-child(2){display:flex;flex:1;flex-direction:column;gap:4px}.themeChoice small{color:#777;font-size:12px}.themePreview{width:44px;height:44px;border-radius:14px;display:flex;align-items:center;justify-content:center;font-size:23px}.themePreviewDefault{background:#f4f4f6;color:#111}.themePreviewDark{background:#111;color:#fff}.themeCheck{opacity:0;color:#fff;background:#111;border-radius:50%;width:23px;height:23px;display:flex;align-items:center;justify-content:center;font-size:13px}.themeChoice.selected{border-color:#111;background:#f7f7f8}.themeChoice.selected .themeCheck{opacity:1}

/* Dark theme: invert the full app surface palette, preserving media and brand accents. */
html.kmDarkTheme,html.kmDarkTheme body,body.kmDarkTheme{background:#101014!important;color:#f4f4f6!important;color-scheme:dark;}
.kmDarkTheme #app,.kmDarkTheme .view,.kmDarkTheme .appPage,.kmDarkTheme .settingsPageInner,.kmDarkTheme .sidebar,.kmDarkTheme .chat,.kmDarkTheme .layout,.kmDarkTheme .topbar,.kmDarkTheme .pageHeading,.kmDarkTheme .settingsGroup,.kmDarkTheme .communityList,.kmDarkTheme .kaiMessages{background-color:#101014!important;color:#f4f4f6!important;}
.kmDarkTheme .card,.kmDarkTheme .user,.kmDarkTheme .settingsProfileCard,.kmDarkTheme .settingsRow,.kmDarkTheme .premiumFeaturesCard,.kmDarkTheme .premiumFeature,.kmDarkTheme .modalCard,.kmDarkTheme .themeCard,.kmDarkTheme .profileCard,.kmDarkTheme .quickAvatarCard,.kmDarkTheme .callCard,.kmDarkTheme .accountRow,.kmDarkTheme .communityItem,.kmDarkTheme .chatCallBtn,.kmDarkTheme .chatSecurityBtn,.kmDarkTheme .chatDeleteBtn,.kmDarkTheme .chatPinBtn:not(.isPinned),.kmDarkTheme .secondary{background-color:#1b1b22!important;color:#f4f4f6!important;border-color:#383842!important;}
.kmDarkTheme input,.kmDarkTheme textarea,.kmDarkTheme select,.kmDarkTheme .search,.kmDarkTheme .composer input,.kmDarkTheme .kaiComposer input{background:#202027!important;color:#f4f4f6!important;border-color:#41414b!important;}
.kmDarkTheme input::placeholder,.kmDarkTheme textarea::placeholder{color:#a1a1ad!important;}
.kmDarkTheme .muted,.kmDarkTheme small,.kmDarkTheme .settingsRow small,.kmDarkTheme .settingsProfileText .muted,.kmDarkTheme .chatHeader .muted,.kmDarkTheme .user .muted,.kmDarkTheme .themeChoice small{color:#b2b2be!important;}
.kmDarkTheme .topbar,.kmDarkTheme .chatHeader,.kmDarkTheme .composer,.kmDarkTheme .settingsGroup,.kmDarkTheme .settingsRow,.kmDarkTheme .settingsProfileCard,.kmDarkTheme .sectionTitle,.kmDarkTheme .sidebar{border-color:#34343d!important;}
.kmDarkTheme .bubble.theirs,.kmDarkTheme .kaiBubble.assistant,.kmDarkTheme .replyPreview,.kmDarkTheme .messageReplyPreview{background:#292932!important;color:#f4f4f6!important;}
.kmDarkTheme .bubble.mine,.kmDarkTheme .kaiBubble.user,.kmDarkTheme .primary{background:#f4f4f6!important;color:#111!important;}
.kmDarkTheme .appPage.chatMode .messages{background-color:#111116!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='190' viewBox='0 0 190 190'%3E%3Cg fill='none' stroke='%23c7b7e8' stroke-opacity='.13' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 25c-8-10-20 2-9 12l9 9 9-9c11-10-1-22-9-12zM117 19l7 14 15 2-11 10 3 15-14-8-13 8 3-15-11-10 15-2zM34 107c0-10 15-10 15 0v15H34zM29 122h25M37 107v-8h10v8M83 77c7-8 18-5 19 4l-3 14H80l-3-14c0-3 2-5 6-6zM139 92c8-8 18-1 13 8l-12 17-12-17c-5-9 3-16 11-8zM155 145c-8-7-17 2-10 10l10 10 10-10c7-8-2-17-10-10zM90 151c-8-8-20 0-13 9l13 13 13-13c7-9-5-17-13-9zM169 103l-6 12h8l-4 10 13-15h-8l4-7z'/%3E%3C/g%3E%3C/svg%3E")!important;}
.kmDarkTheme .appPage.chatMode .messages::before{background:linear-gradient(180deg,rgba(0,0,0,.12),rgba(0,0,0,.02))!important;}
.kmDarkTheme .bottomNav{background:rgba(24,24,30,.94)!important;border-color:#3a3a44!important;color:#f4f4f6!important;}
.kmDarkTheme .navItem{color:#c9c9d3!important}.kmDarkTheme .navItem.active{background:#f4f4f6!important;color:#111!important;}
.kmDarkTheme .themeChoice{background:#1b1b22!important;color:#f4f4f6!important;border-color:#3c3c46!important}.kmDarkTheme .themeChoice.selected{background:#272730!important;border-color:#f4f4f6!important}.kmDarkTheme .themeCheck{background:#f4f4f6!important;color:#111!important;}
.kmDarkTheme .user.pinnedChat{background:#202027!important;border-color:#a9a9b7!important;box-shadow:none!important}.kmDarkTheme .user.pinnedChat::before{background:#f4f4f6!important}.kmDarkTheme .chatPinBtn.isPinned{background:#f4f4f6!important;color:#111!important;border-color:#f4f4f6!important;}
.kmDarkTheme .premiumFeatureIcon{background:#f4f4f6!important;color:#111!important}.kmDarkTheme .premiumFeature p{color:#b2b2be!important}.kmDarkTheme .chatCallBtn{box-shadow:none!important}.kmDarkTheme .callKicker{color:#c0c0ca!important}
.kmDarkTheme .modal,.kmDarkTheme .callModal{color:#f4f4f6!important}
.kmDarkTheme .startupSplash{background:#101014!important;color:#f4f4f6!important}


/* V33: chat wallpaper, compact equal contact cards and global theme switch */
#messages{background-color:#f8f7fb;background-image:linear-gradient(rgba(255,255,255,.78),rgba(255,255,255,.78)),url("chat-doodles.png");background-repeat:repeat;background-size:auto,420px 420px;background-position:center top;}
#usersList .user{min-height:78px;padding:11px 13px;gap:10px;border-radius:20px;}
#usersList .userAvatar,#usersList .avatarButton{width:46px;height:46px;min-width:46px;min-height:46px;flex-basis:46px;outline:0!important;box-shadow:none!important;}
#usersList .user.pinnedChat{padding-left:16px;}
#usersList .user.pinnedChat::before{left:0;top:10px;bottom:10px;width:3px;}
@media(max-width:700px){#usersList .user{min-height:76px;padding:10px 11px;gap:9px}#usersList .userAvatar,#usersList .avatarButton{width:44px;height:44px;min-width:44px;min-height:44px;flex-basis:44px}#usersList .userMain strong{font-size:16px}}
.settingsThemeRow{padding:15px 16px;border-bottom:1px solid var(--theme-border,#e7e7e7);display:flex;flex-direction:column;gap:12px}.settingsThemeLabel{display:flex;align-items:center;gap:12px}.settingsThemeLabel>span:nth-child(2){display:flex;flex-direction:column;gap:4px}.settingsThemeLabel small{font-size:12px;color:var(--theme-muted,#777)}.themeChoices{display:flex;gap:8px;padding-left:40px}.themeChoice{border:1px solid var(--theme-border,#ddd);background:var(--theme-card,#fff);color:var(--theme-text,#111);border-radius:12px;padding:9px 13px;font-size:14px;cursor:pointer}.themeChoice.active{background:var(--theme-selected,#111);color:var(--theme-selected-text,#fff);border-color:var(--theme-selected,#111)}
html[data-app-theme="dark"]{color-scheme:dark;--theme-bg:#101014;--theme-card:#1c1c22;--theme-panel:#17171d;--theme-text:#f5f5f7;--theme-muted:#a5a5af;--theme-border:#34343d;--theme-hover:#292930;--theme-input:#24242b;--theme-selected:#f4f4f6;--theme-selected-text:#101014;}
html[data-app-theme="light"]{color-scheme:light;--theme-bg:#fff;--theme-card:#fff;--theme-panel:#fafafa;--theme-text:#111;--theme-muted:#777;--theme-border:#ddd;--theme-hover:#f1f1f1;--theme-input:#fff;--theme-selected:#111;--theme-selected-text:#fff;}
html[data-app-theme="dark"] body,html[data-app-theme="dark"] .view{background:var(--theme-bg)!important;color:var(--theme-text)!important}
html[data-app-theme="dark"] .card,html[data-app-theme="dark"] .settingsProfileCard,html[data-app-theme="dark"] .settingsGroup,html[data-app-theme="dark"] .settingsRow,html[data-app-theme="dark"] .settingsThemeRow,html[data-app-theme="dark"] .user,html[data-app-theme="dark"] .modalCard,html[data-app-theme="dark"] .premiumFeaturesCard{background:var(--theme-card)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-app-theme="dark"] .topbar,html[data-app-theme="dark"] .chatHeader,html[data-app-theme="dark"] .composer,html[data-app-theme="dark"] .settingsPageInner,html[data-app-theme="dark"] .pageHeading,html[data-app-theme="dark"] .bottomNav,html[data-app-theme="dark"] .appPage,html[data-app-theme="dark"] .sidebar,html[data-app-theme="dark"] .layout{background:var(--theme-bg)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-app-theme="dark"] input,html[data-app-theme="dark"] textarea,html[data-app-theme="dark"] select,html[data-app-theme="dark"] .search,html[data-app-theme="dark"] #messageInput,html[data-app-theme="dark"] #kaiInput{background:var(--theme-input)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-app-theme="dark"] button:not(.primary):not(.callHangupBtn):not(.callAcceptBtn):not(.navItem.active),html[data-app-theme="dark"] .secondary,html[data-app-theme="dark"] .chatBackBtn,html[data-app-theme="dark"] .chatDeleteBtn{color:var(--theme-text);border-color:var(--theme-border)}
html[data-app-theme="dark"] .muted,html[data-app-theme="dark"] small,html[data-app-theme="dark"] .notificationText{color:var(--theme-muted)!important}
html[data-app-theme="dark"] .theirs,html[data-app-theme="dark"] .kaiBubble.assistant,html[data-app-theme="dark"] .messageActions .miniBtn{background:#303039!important;color:#f5f5f7!important}
html[data-app-theme="dark"] .mine,html[data-app-theme="dark"] .kaiBubble.user{background:#f0f0f5!important;color:#101014!important}
html[data-app-theme="dark"] #messages{background-color:#101014;background-image:linear-gradient(rgba(12,12,17,.58),rgba(12,12,17,.58)),url("chat-doodles.png")}
html[data-app-theme="dark"] .notificationBar,html[data-app-theme="dark"] .callCard,html[data-app-theme="dark"] .profileCard,html[data-app-theme="dark"] .quickAvatarCard{background:var(--theme-card)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-app-theme="dark"] .themeChoice.active{background:#f4f4f6!important;color:#101014!important}
html[data-app-theme="dark"] .bottomNav{box-shadow:0 0 0 1px var(--theme-border)}
html[data-app-theme="dark"] .settingsIcon,html[data-app-theme="dark"] .navItem.active,html[data-app-theme="dark"] .secondary,html[data-app-theme="dark"] .reactionBtn,html[data-app-theme="dark"] .miniBtn{background:#303039!important;color:#f5f5f7!important;border-color:#454550!important}
html[data-app-theme="dark"] .settingsLogout{background:#351d23!important;color:#ffb8c0!important;border-color:#67303a!important}
html[data-app-theme="dark"] .topbar,html[data-app-theme="dark"] .topbar *{border-color:var(--theme-border)}
html[data-app-theme="dark"] .user:hover,html[data-app-theme="dark"] .settingsRow:active,html[data-app-theme="dark"] .settingsProfileCard:active{background:var(--theme-hover)!important}
html[data-app-theme="dark"] .chatBackBtn,html[data-app-theme="dark"] .chatDeleteBtn,html[data-app-theme="dark"] .chatCallBtn,html[data-app-theme="dark"] .chatSecurityBtn{background:var(--theme-card)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-app-theme="dark"] .bottomNav .navItem{color:var(--theme-muted)}html[data-app-theme="dark"] .bottomNav .navItem.active{background:#34343d!important;color:#fff!important}
html[data-app-theme="dark"] .empty,html[data-app-theme="dark"] .settingsChevron{color:var(--theme-muted)!important}

/* V34: compact, equal-sized chat list cards on all account types */
#usersList .user{min-height:78px!important;padding:11px 12px!important;gap:10px!important;border-radius:18px!important;}
#usersList .userAvatar,#usersList .avatarButton{width:48px!important;height:48px!important;min-width:48px!important;min-height:48px!important;flex:0 0 48px!important;outline:none!important;box-shadow:none!important;}
#usersList .user.premiumChat,#usersList .user:has(.premiumBadge){min-height:78px!important;}
@media(max-width:700px){#usersList .user{min-height:76px!important;padding:10px!important;gap:9px!important;}#usersList .userAvatar,#usersList .avatarButton{width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;flex-basis:46px!important;}}


/* V35: keep mobile scrolling/compositing lightweight and respect accessibility settings. */
#usersList{content-visibility:auto;contain-intrinsic-size:1px 720px;}
#messages{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable;}
.bubble,.user,.chatCallBtn,.topIconButton{will-change:auto;}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important;}}


/* KARMADONOV V36 — Liquid Glass, safe-area and interaction polish.
   The app keeps a solid fallback when backdrop filters are unavailable or disabled. */
:root{--km-glass-light:rgba(255,255,255,.76);--km-glass-dark:rgba(24,24,30,.76);--km-stroke-light:rgba(255,255,255,.68);--km-stroke-dark:rgba(255,255,255,.13);--km-motion-fast:150ms;}
html,body{min-height:100%;overscroll-behavior-x:none;-webkit-tap-highlight-color:transparent;}
button,[role="button"],input,select,textarea{-webkit-tap-highlight-color:transparent;}
button{touch-action:manipulation;}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:2px solid #6a8cff;outline-offset:2px;}
.topbar,.chatHeader,.composer,.kaiHeader,.kaiComposer,.bottomNav{backdrop-filter:blur(24px) saturate(1.5);-webkit-backdrop-filter:blur(24px) saturate(1.5);}
.topbar{background:rgba(255,255,255,.78);border-bottom-color:rgba(115,115,125,.18);box-shadow:0 1px 0 rgba(255,255,255,.36);}
.chatHeader{background:rgba(255,255,255,.73);border-bottom-color:rgba(115,115,125,.18);}
.appPage.chatMode .chatHeader{position:relative;}
.appPage.chatMode .chatHeader::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:1px;pointer-events:none;background:linear-gradient(90deg,transparent,rgba(255,255,255,.7),transparent);}
.bottomNav{background:rgba(255,255,255,.78);border-color:rgba(255,255,255,.72);box-shadow:0 14px 36px rgba(24,24,40,.16),inset 0 1px 0 rgba(255,255,255,.75);padding:7px;}
.bottomNav::before{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(135deg,rgba(255,255,255,.28),transparent 52%,rgba(160,170,210,.06));z-index:-1;}
.navItem{transition:background-color var(--km-motion-fast) ease,color var(--km-motion-fast) ease,transform var(--km-motion-fast) ease;}
.navItem.active{background:rgba(30,30,40,.085);box-shadow:inset 0 1px 0 rgba(255,255,255,.6);}
.navItem:active,.settingsRow:active,.chatCallBtn:active,.topIconButton:active,.topAvatarButton:active{transform:scale(.975);}
.appPage.chatMode .composer{background:rgba(255,255,255,.78)!important;border-top-color:rgba(130,130,145,.2)!important;box-shadow:0 -8px 28px rgba(24,24,40,.065)!important;}
.composer input,.kaiComposer input{box-shadow:inset 0 1px 2px rgba(0,0,0,.025);transition:border-color var(--km-motion-fast) ease,box-shadow var(--km-motion-fast) ease;}
.composer input:focus,.kaiComposer input:focus{border-color:rgba(70,90,160,.64)!important;box-shadow:0 0 0 3px rgba(105,130,240,.11);}
.kaiPageInner,.kaiHeader{background:rgba(255,255,255,.74);}
.kaiHeader{border-bottom-color:rgba(130,130,145,.2);}
.kaiComposer{background:rgba(255,255,255,.78);border-top-color:rgba(130,130,145,.2);}
.bubble{contain:layout style;box-shadow:0 1px 1px rgba(0,0,0,.025);}
.user{transition:background-color var(--km-motion-fast) ease,border-color var(--km-motion-fast) ease,box-shadow var(--km-motion-fast) ease;}
.user:active{transform:scale(.995);}
.modal{background:rgba(8,10,18,.38);backdrop-filter:blur(9px) saturate(1.2);-webkit-backdrop-filter:blur(9px) saturate(1.2);}
.callModal{background:rgba(7,8,14,.58);backdrop-filter:blur(18px) saturate(1.15);-webkit-backdrop-filter:blur(18px) saturate(1.15);}
.settingsEffectsState{margin-left:auto;flex:0 0 auto;font-size:12px;font-weight:800;color:#4c6bd9;background:rgba(90,115,230,.1);padding:6px 9px;border-radius:999px;}
#messages,#kaiMessages{-webkit-overflow-scrolling:touch;overscroll-behavior:contain;scrollbar-width:thin;}
#messages .bubble .body{overflow-wrap:anywhere;}
.messageMediaImage,.messageMediaVideo{content-visibility:auto;}
img{image-rendering:auto;}
@supports (height: 100dvh){.view{min-height:100dvh}.appPage{min-height:calc(100dvh - 83px)}#kaiPage{height:calc(100dvh - 150px)}}
@supports (height: 100dvh) and (width: 1px){@media(max-width:800px){.appPage{min-height:calc(100dvh - 74px)}.layout{min-height:calc(100dvh - 160px)}.chat{min-height:calc(100dvh - 330px)}#kaiPage{height:calc(100dvh - 128px)}}}
@media(max-width:800px){
  .topbar{padding-top:max(10px,env(safe-area-inset-top));}
  .bottomNav{bottom:calc(8px + env(safe-area-inset-bottom))!important;left:10px!important;right:10px!important;}
  .navItem{gap:4px;padding:9px 5px;}
  .navItem span{font-size:19px;}
  .navItem strong{font-size:11px!important;white-space:nowrap;}
  .appPage.chatMode .chatHeader{padding-top:max(9px,env(safe-area-inset-top));}
  .appPage.chatMode .composer{padding-bottom:calc(8px + env(safe-area-inset-bottom))!important;}
  .appPage.chatMode .messages{padding-bottom:calc(96px + env(safe-area-inset-bottom))!important;}
  .kaiComposer{padding-bottom:calc(10px + env(safe-area-inset-bottom));}
  .settingsRow{min-height:72px;}
}
@media(max-width:370px){.navItem strong{font-size:10px!important}.bottomNav{gap:2px;padding:5px}.navItem{padding-left:2px;padding-right:2px}.chatCallActions{gap:3px}.chatCallBtn{width:32px;height:32px;flex-basis:32px;}}
.kmDarkTheme .topbar,.kmDarkTheme .chatHeader,.kmDarkTheme .appPage.chatMode .composer,.kmDarkTheme .kaiHeader,.kmDarkTheme .kaiComposer{background:rgba(25,25,32,.79)!important;border-color:rgba(255,255,255,.12)!important;}
.kmDarkTheme .bottomNav{background:rgba(26,26,34,.78)!important;border-color:rgba(255,255,255,.14)!important;box-shadow:0 14px 36px rgba(0,0,0,.34),inset 0 1px 0 rgba(255,255,255,.09)!important;}
.kmDarkTheme .bottomNav::before{background:linear-gradient(135deg,rgba(255,255,255,.09),transparent 54%,rgba(120,130,180,.07));}
.kmDarkTheme .navItem.active{background:rgba(255,255,255,.13)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.11);}
.kmDarkTheme .settingsEffectsState{color:#c9d4ff;background:rgba(120,145,255,.16);}
.kmNoGlass .topbar,.kmNoGlass .chatHeader,.kmNoGlass .composer,.kmNoGlass .kaiHeader,.kmNoGlass .kaiComposer,.kmNoGlass .bottomNav,.kmNoGlass .modal,.kmNoGlass .callModal{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;}
.kmNoGlass .topbar{background:#fff!important;}.kmNoGlass .chatHeader{background:#fff!important;}.kmNoGlass .appPage.chatMode .composer,.kmNoGlass .kaiComposer{background:#fff!important;}.kmNoGlass .kaiHeader{background:#fff!important;}.kmNoGlass .bottomNav{background:rgba(255,255,255,.97)!important;box-shadow:0 8px 22px rgba(20,20,35,.12)!important;}
.kmNoGlass .modal,.kmNoGlass .callModal{background:rgba(8,10,18,.52)!important;}
.kmDarkTheme.kmNoGlass .topbar,.kmDarkTheme.kmNoGlass .chatHeader,.kmDarkTheme.kmNoGlass .appPage.chatMode .composer,.kmDarkTheme.kmNoGlass .kaiComposer,.kmDarkTheme.kmNoGlass .kaiHeader{background:#19191f!important;}
.kmDarkTheme.kmNoGlass .bottomNav{background:rgba(25,25,31,.98)!important;}
@media(prefers-reduced-motion:reduce){.user:active,.navItem:active,.settingsRow:active{transform:none!important}.modal,.callModal{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;}}
@media(prefers-reduced-transparency:reduce){.topbar,.chatHeader,.composer,.kaiHeader,.kaiComposer,.bottomNav{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;background:rgba(255,255,255,.98)!important}.kmDarkTheme .topbar,.kmDarkTheme .chatHeader,.kmDarkTheme .composer,.kmDarkTheme .kaiHeader,.kmDarkTheme .kaiComposer,.kmDarkTheme .bottomNav{background:rgba(25,25,31,.98)!important}}

/* KARMADONOV V37 — unified, calm glass surfaces and compact message reactions. */
:root{--v37-light-bg:#f4f4f7;--v37-light-surface:rgba(255,255,255,.76);--v37-light-solid:#fff;--v37-light-border:rgba(70,70,85,.13);--v37-dark-bg:#101014;--v37-dark-surface:rgba(29,29,36,.78);--v37-dark-solid:#202027;--v37-dark-border:rgba(255,255,255,.11);--v37-radius:22px;--v37-glass-blur:blur(24px) saturate(1.45);}
html,body{background:var(--v37-light-bg);color:#17171b;}
#messengerView{background:var(--v37-light-bg);}
.topbar,.chatHeader,.composer,.kaiHeader,.kaiComposer,.bottomNav,.premiumFeaturesCard,.premiumPlansCard,.premiumHeroCard,.premiumGiftsCard{border-color:var(--v37-light-border)!important;}
.topbar,.chatHeader,.composer,.kaiHeader,.kaiComposer,.bottomNav{background:var(--v37-light-surface)!important;backdrop-filter:var(--v37-glass-blur)!important;-webkit-backdrop-filter:var(--v37-glass-blur)!important;}
.topbar{box-shadow:0 1px 0 rgba(255,255,255,.6),0 5px 24px rgba(24,24,40,.035)!important;}
.chatHeader,.kaiHeader{box-shadow:0 1px 0 rgba(255,255,255,.36)!important;}
.bottomNav{border:1px solid rgba(255,255,255,.72)!important;box-shadow:0 12px 32px rgba(20,20,35,.12),inset 0 1px 0 rgba(255,255,255,.72)!important;}
.appPage.chatMode .composer,.kaiComposer{box-shadow:0 -8px 26px rgba(24,24,40,.045)!important;}
.kaiPageInner{background:transparent!important;}
.kaiHeader .kaiTitle,.kaiHeader h1,.kaiHeader h2,.kaiHeader strong{color:inherit!important;}
.composer input,.kaiComposer input,#messageInput,#kaiInput{background:rgba(125,125,140,.09)!important;border:1px solid var(--v37-light-border)!important;border-radius:999px!important;color:inherit!important;}
.bubble{border-radius:23px!important;box-shadow:0 2px 8px rgba(25,25,40,.035)!important;}
.bubble.mine{background:#292930!important;color:#f7f7fa!important;}
.bubble.theirs{background:rgba(255,255,255,.91)!important;color:#17171b!important;border:1px solid rgba(60,60,80,.07)!important;}
.reactions{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-top:8px;min-height:0;}
.reactionBtn{display:inline-flex;align-items:center;justify-content:center;gap:3px;min-width:30px;min-height:29px;padding:3px 8px!important;border-radius:999px!important;background:rgba(120,120,140,.09)!important;border:1px solid rgba(100,100,120,.13)!important;font-size:16px!important;line-height:1.1;}
.reactionBtn span{font-size:11px!important;font-weight:750!important;margin:0!important;opacity:.8;}
.mine .reactionBtn{background:rgba(255,255,255,.10)!important;border-color:rgba(255,255,255,.13)!important;}
.reactionAddBtn{width:29px;height:29px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid rgba(100,100,120,.15);background:rgba(120,120,140,.07);color:inherit;font-size:19px;line-height:1;cursor:pointer;transition:background .15s ease,transform .15s ease;}
.reactionAddBtn:active{transform:scale(.92);}
.mine .reactionAddBtn{background:rgba(255,255,255,.09);border-color:rgba(255,255,255,.14);}
.premiumFeaturesCard{border-radius:20px!important;background:var(--v37-light-surface)!important;backdrop-filter:var(--v37-glass-blur);-webkit-backdrop-filter:var(--v37-glass-blur);padding:16px!important;}
.premiumFeaturesHeading{display:flex;align-items:center;justify-content:space-between;gap:14px;}
.premiumFeaturesHeading h2{font-size:17px!important;line-height:1.3;margin:0!important;}
.premiumFeaturesToggle{flex:0 0 auto;border:1px solid rgba(100,100,120,.18);border-radius:999px;background:rgba(120,120,140,.08);color:inherit;padding:9px 15px;font-size:14px;font-weight:700;cursor:pointer;transition:transform .15s ease,background .15s ease;}
.premiumFeaturesToggle:active{transform:scale(.97);}
.premiumFeatures{margin-top:14px;}
.premiumFeature{background:rgba(125,125,140,.055)!important;border-color:var(--v37-light-border)!important;border-radius:16px!important;}
.premiumFeatureIcon{border-radius:12px!important;background:#292930!important;color:#fff!important;}
html.kmDarkTheme,body.kmDarkTheme,html.kmDarkTheme body,body.kmDarkTheme #messengerView{background:var(--v37-dark-bg)!important;color:#f4f4f7!important;}
.kmDarkTheme .topbar,.kmDarkTheme .chatHeader,.kmDarkTheme .composer,.kmDarkTheme .kaiHeader,.kmDarkTheme .kaiComposer,.kmDarkTheme .bottomNav,.kmDarkTheme .premiumFeaturesCard,.kmDarkTheme .premiumPlansCard,.kmDarkTheme .premiumHeroCard,.kmDarkTheme .premiumGiftsCard{background:var(--v37-dark-surface)!important;border-color:var(--v37-dark-border)!important;color:#f4f4f7!important;backdrop-filter:var(--v37-glass-blur)!important;-webkit-backdrop-filter:var(--v37-glass-blur)!important;}
.kmDarkTheme .kaiPageInner{background:transparent!important;}
.kmDarkTheme .bubble.mine{background:#2b2b33!important;color:#f7f7fa!important;}
.kmDarkTheme .bubble.theirs{background:#24242b!important;color:#f4f4f7!important;border-color:rgba(255,255,255,.06)!important;}
.kmDarkTheme .composer input,.kmDarkTheme .kaiComposer input,.kmDarkTheme #messageInput,.kmDarkTheme #kaiInput{background:rgba(255,255,255,.075)!important;border-color:var(--v37-dark-border)!important;color:#f7f7fa!important;}
.kmDarkTheme .reactionBtn,.kmDarkTheme .reactionAddBtn,.kmDarkTheme .premiumFeaturesToggle{background:rgba(255,255,255,.075)!important;border-color:rgba(255,255,255,.12)!important;color:#f4f4f7!important;}
.kmDarkTheme .premiumFeature{background:rgba(255,255,255,.045)!important;border-color:var(--v37-dark-border)!important;}
.kmDarkTheme .premiumFeature p{color:rgba(244,244,247,.68)!important;}
.kmDarkTheme .navItem.active{background:rgba(255,255,255,.12)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.09)!important;}
.kmDarkTheme .bubble .time{color:inherit;opacity:.56;}
@media(max-width:700px){.premiumFeaturesHeading h2{font-size:15px!important}.premiumFeaturesToggle{padding:8px 13px;font-size:13px}.premiumFeaturesCard{padding:14px!important}.reactions{gap:4px}.reactionBtn{min-height:27px;padding:3px 7px!important;font-size:15px!important}.reactionAddBtn{width:27px;height:27px}}
@media(prefers-reduced-transparency:reduce){.topbar,.chatHeader,.composer,.kaiHeader,.kaiComposer,.bottomNav,.premiumFeaturesCard{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;background:rgba(255,255,255,.97)!important}.kmDarkTheme .topbar,.kmDarkTheme .chatHeader,.kmDarkTheme .composer,.kmDarkTheme .kaiHeader,.kmDarkTheme .kaiComposer,.kmDarkTheme .bottomNav,.kmDarkTheme .premiumFeaturesCard{background:rgba(29,29,36,.98)!important}}

/* KARMADONOV V38 — restrained iOS-style glass, consistent monochrome surfaces. */
:root{
  --v38-blur:blur(30px) saturate(1.65);
  --v38-light-glass:rgba(250,250,253,.66);
  --v38-light-line:rgba(255,255,255,.68);
  --v38-light-stroke:rgba(45,45,58,.12);
  --v38-dark-glass:rgba(25,25,32,.68);
  --v38-dark-line:rgba(255,255,255,.12);
  --v38-dark-stroke:rgba(255,255,255,.12);
  --v38-ease:cubic-bezier(.2,.75,.25,1);
}
html,body{background:#f1f1f5;color:#17171c;}
#messengerView{background:linear-gradient(180deg,rgba(255,255,255,.28),transparent 28%),#f1f1f5;}
.topbar,.chatHeader,.appPage.chatMode .composer,.kaiHeader,.kaiComposer,.bottomNav{
  background:var(--v38-light-glass)!important;
  border-color:var(--v38-light-stroke)!important;
  -webkit-backdrop-filter:var(--v38-blur)!important;
  backdrop-filter:var(--v38-blur)!important;
  transition:background-color .24s var(--v38-ease),border-color .24s var(--v38-ease),box-shadow .24s var(--v38-ease),transform .24s var(--v38-ease);
}
.topbar{box-shadow:0 1px 0 var(--v38-light-line),0 8px 28px rgba(30,30,45,.055)!important;}
.chatHeader,.kaiHeader{box-shadow:0 1px 0 var(--v38-light-line)!important;}
.appPage.chatMode .composer,.kaiComposer{box-shadow:0 -10px 32px rgba(30,30,45,.075)!important;}
.bottomNav{background:rgba(250,250,253,.62)!important;border:1px solid var(--v38-light-line)!important;box-shadow:0 14px 38px rgba(25,25,40,.15),inset 0 1px 0 rgba(255,255,255,.82)!important;}
.navItem{transition:background-color .2s var(--v38-ease),color .2s var(--v38-ease),transform .2s var(--v38-ease)!important;}
.navItem.active{background:rgba(80,80,100,.12)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.65)!important;}
.chatHeader,.kaiHeader,.topbar{isolation:isolate;}
.composer input,.kaiComposer input,#messageInput,#kaiInput{background:rgba(255,255,255,.48)!important;border:1px solid rgba(70,70,85,.12)!important;box-shadow:inset 0 1px 2px rgba(20,20,30,.035)!important;transition:background .2s,border-color .2s,box-shadow .2s!important;}
.composer input:focus,.kaiComposer input:focus,#messageInput:focus,#kaiInput:focus{background:rgba(255,255,255,.78)!important;border-color:rgba(80,95,145,.34)!important;box-shadow:0 0 0 4px rgba(100,115,170,.10)!important;}
.bubble{transition:transform .18s var(--v38-ease),box-shadow .18s var(--v38-ease)!important;}
.bubble.mine{background:#303039!important;color:#f8f8fa!important;}
.bubble.theirs{background:rgba(255,255,255,.78)!important;border-color:rgba(80,80,95,.09)!important;}
.kaiPageInner{background:transparent!important;}
.kaiBubble.assistant{background:rgba(255,255,255,.78)!important;color:#202027!important;border:1px solid rgba(70,70,85,.08)!important;box-shadow:0 8px 26px rgba(20,20,35,.045)!important;}
.kaiBubble.user{background:#303039!important;color:#f8f8fa!important;}
.modal,.callModal,.messageContextMenu{ -webkit-backdrop-filter:blur(24px) saturate(1.4)!important;backdrop-filter:blur(24px) saturate(1.4)!important;}
.kmDarkTheme #messengerView{background:radial-gradient(ellipse at 50% -20%,rgba(105,105,145,.10),transparent 55%),#101014!important;}
.kmDarkTheme .topbar,.kmDarkTheme .chatHeader,.kmDarkTheme .appPage.chatMode .composer,.kmDarkTheme .kaiHeader,.kmDarkTheme .kaiComposer,.kmDarkTheme .bottomNav{
  background:var(--v38-dark-glass)!important;border-color:var(--v38-dark-stroke)!important;
  -webkit-backdrop-filter:var(--v38-blur)!important;backdrop-filter:var(--v38-blur)!important;
}
.kmDarkTheme .topbar,.kmDarkTheme .chatHeader,.kmDarkTheme .kaiHeader{box-shadow:0 1px 0 var(--v38-dark-line),0 8px 28px rgba(0,0,0,.14)!important;}
.kmDarkTheme .bottomNav{background:rgba(25,25,32,.62)!important;box-shadow:0 14px 38px rgba(0,0,0,.36),inset 0 1px 0 rgba(255,255,255,.10)!important;}
.kmDarkTheme .navItem.active{background:rgba(255,255,255,.13)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.12)!important;}
.kmDarkTheme .composer input,.kmDarkTheme .kaiComposer input,.kmDarkTheme #messageInput,.kmDarkTheme #kaiInput{background:rgba(255,255,255,.065)!important;border-color:rgba(255,255,255,.12)!important;color:#f7f7fa!important;}
.kmDarkTheme .composer input:focus,.kmDarkTheme .kaiComposer input:focus,.kmDarkTheme #messageInput:focus,.kmDarkTheme #kaiInput:focus{background:rgba(255,255,255,.10)!important;border-color:rgba(190,195,230,.30)!important;box-shadow:0 0 0 4px rgba(160,170,220,.10)!important;}
.kmDarkTheme .bubble.mine,.kmDarkTheme .kaiBubble.user{background:#303039!important;color:#f8f8fa!important;}
.kmDarkTheme .bubble.theirs,.kmDarkTheme .kaiBubble.assistant{background:rgba(39,39,47,.84)!important;color:#f4f4f7!important;border-color:rgba(255,255,255,.07)!important;}
.kmDarkTheme .modal,.kmDarkTheme .callModal,.kmDarkTheme .messageContextMenu{-webkit-backdrop-filter:blur(24px) saturate(1.4)!important;backdrop-filter:blur(24px) saturate(1.4)!important;}
@media(max-width:800px){
 .topbar{padding-left:16px;padding-right:16px;}
 .bottomNav{left:12px!important;right:12px!important;bottom:calc(10px + env(safe-area-inset-bottom))!important;border-radius:26px!important;}
 .appPage.chatMode .chatHeader{padding-left:14px;padding-right:14px;}
 .appPage.chatMode .composer,.kaiComposer{padding-left:12px;padding-right:12px;}
}
@media(prefers-reduced-motion:reduce){.topbar,.chatHeader,.appPage.chatMode .composer,.kaiHeader,.kaiComposer,.bottomNav,.navItem,.bubble{transition:none!important;}}
@media(prefers-reduced-transparency:reduce){.topbar,.chatHeader,.appPage.chatMode .composer,.kaiHeader,.kaiComposer,.bottomNav{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;background:rgba(248,248,251,.97)!important}.kmDarkTheme .topbar,.kmDarkTheme .chatHeader,.kmDarkTheme .appPage.chatMode .composer,.kmDarkTheme .kaiHeader,.kmDarkTheme .kaiComposer,.kmDarkTheme .bottomNav{background:rgba(25,25,32,.98)!important}}


/* Karmadonov V39: keep chat content scrolling separate from its identity header. */
@media (max-width: 800px) {
  #chatsPage.chatMode {
    height: calc(100dvh - 74px) !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  #chatsPage.chatMode .layout {
    display: block !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  #chatsPage.chatMode .chat {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  #chatsPage.chatMode .chatHeader {
    position: relative !important;
    top: auto !important;
    flex: 0 0 auto !important;
    z-index: 25 !important;
  }
  #chatsPage.chatMode #messages {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }
  #kaiPage {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100dvh - 128px) !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  #kaiPage .kaiPageInner {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  #kaiPage .kaiHeader {
    position: relative !important;
    top: auto !important;
    flex: 0 0 72px !important;
    z-index: 25 !important;
  }
  #kaiPage #kaiMessages {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }
  #kaiPage .kaiComposer {
    position: relative !important;
    bottom: auto !important;
    flex: 0 0 auto !important;
    z-index: 25 !important;
  }
}

/* V39: true dark surfaces throughout My Cups, including nested Premium cards. */
.kmDarkTheme #cupsPage,
.kmDarkTheme #cupsPage .cupsPageInner {
  background: #101014 !important;
  color: #f4f4f7 !important;
}
.kmDarkTheme #cupsPage .coffeeBalanceCard,
.kmDarkTheme #cupsPage .premiumPlansCard,
.kmDarkTheme #cupsPage .premiumFeaturesCard,
.kmDarkTheme #cupsPage .coffeeGiftCard,
.kmDarkTheme #cupsPage .premiumGiftsCard,
.kmDarkTheme #cupsPage .coffeeHistoryCard {
  background: rgba(29,29,36,.90) !important;
  color: #f4f4f7 !important;
  border: 1px solid rgba(255,255,255,.11) !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.16) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.35) !important;
  backdrop-filter: blur(22px) saturate(1.35) !important;
}
.kmDarkTheme #cupsPage .premiumPlan,
.kmDarkTheme #cupsPage .premiumGift {
  background: #25252e !important;
  color: #f4f4f7 !important;
  border-color: rgba(255,255,255,.12) !important;
}
.kmDarkTheme #cupsPage .premiumPlan.featured {
  background: #111116 !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.18) !important;
}
.kmDarkTheme #cupsPage .premiumPlan h3,
.kmDarkTheme #cupsPage .premiumPlanPrice,
.kmDarkTheme #cupsPage .premiumGiftName,
.kmDarkTheme #cupsPage .coffeeGiftCard h2,
.kmDarkTheme #cupsPage .coffeeHistoryCard h2,
.kmDarkTheme #cupsPage .premiumSectionHeader h2 {
  color: #f4f4f7 !important;
}
.kmDarkTheme #cupsPage .premiumPlanNote,
.kmDarkTheme #cupsPage .premiumGiftNote,
.kmDarkTheme #cupsPage .premiumSectionHeader p,
.kmDarkTheme #cupsPage .coffeeGiftCard p,
.kmDarkTheme #cupsPage .coffeeHistoryItem small,
.kmDarkTheme #cupsPage .coffeeUnit,
.kmDarkTheme #cupsPage .coffeeBalanceCard .muted {
  color: #a9a9b5 !important;
}
.kmDarkTheme #cupsPage select,
.kmDarkTheme #cupsPage input {
  background: #25252e !important;
  color: #f4f4f7 !important;
  border-color: rgba(255,255,255,.14) !important;
  color-scheme: dark;
}
.kmDarkTheme #cupsPage select option {
  background: #25252e !important;
  color: #f4f4f7 !important;
}
.kmDarkTheme #cupsPage .coffeeMessage {
  background: #292932 !important;
  color: #f4f4f7 !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
.kmDarkTheme #cupsPage .coffeeMessage.error {
  background: #351d23 !important;
  color: #ffb8c0 !important;
}
.kmDarkTheme #cupsPage .coffeeHistoryItem {
  border-color: rgba(255,255,255,.09) !important;
}
.kmDarkTheme #cupsPage .coffeeHistoryIcon {
  background: #303039 !important;
}
.kmDarkTheme #cupsPage .coffeeHistoryAmount.in {
  color: #f4f4f7 !important;
}
.kmDarkTheme #cupsPage .coffeeHistoryAmount.out {
  color: #a9a9b5 !important;
}
.kmDarkTheme #cupsPage .premiumPlan.featured .premiumBuyBtn {
  background: #f4f4f7 !important;
  color: #101014 !important;
}
@media (prefers-reduced-transparency: reduce) {
  .kmDarkTheme #cupsPage .coffeeBalanceCard,
  .kmDarkTheme #cupsPage .premiumPlansCard,
  .kmDarkTheme #cupsPage .premiumFeaturesCard,
  .kmDarkTheme #cupsPage .coffeeGiftCard,
  .kmDarkTheme #cupsPage .premiumGiftsCard,
  .kmDarkTheme #cupsPage .coffeeHistoryCard {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: #1d1d24 !important;
  }
}
