* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: #0B0B14; color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none;
}
#app { height: 100%; display: flex; flex-direction: column; }
.boot { margin: auto; font-size: 34px; font-weight: 700; }
button { font-family: inherit; }
.screen { height: 100%; display: flex; flex-direction: column; }
.center-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.glow { position: fixed; top: 0; left: 0; right: 0; height: 340px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(123,92,255,.30), transparent); animation: glowpulse 2.2s ease-in-out infinite alternate; }
@keyframes glowpulse { from { opacity: .55; } to { opacity: 1; } }
.logo-box { width: 88px; height: 88px; border-radius: 26px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7B5CFF, #4F7BFF); box-shadow: 0 0 60px rgba(123,92,255,.45); margin-bottom: 18px; }
.logo-box img { width: 56px; height: 56px; border-radius: 14px; }
.appname { font-size: 34px; font-weight: 700; }
.tagline { color: #8E8EA0; font-size: 14px; margin-top: 2px; }
.card { width: 100%; max-width: 420px; margin-top: 26px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  border-radius: 28px; padding: 20px; display: flex; flex-direction: column; align-items: center; }
.card h2 { font-size: 20px; font-weight: 600; }
.helper { color: #8E8EA0; font-size: 12px; text-align: center; margin-top: 6px; line-height: 1.45; direction: ltr; }
.field { width: 100%; margin-top: 14px; }
.field input, .field textarea {
  width: 100%; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.16); border-radius: 18px;
  padding: 13px 16px; color: #fff; font-size: 16px; outline: none; direction: ltr; text-align: left;
}
.field input:focus, .field textarea:focus { border-color: #4F7BFF; background: rgba(255,255,255,.09); }
.field label { display: block; font-size: 12px; color: #8E8EA0; margin: 0 4px 6px; }
.phone-row { display: flex; margin-top: 14px; width: 100%; }
.phone-row .cc { width: 96px; margin-right: 10px; }
.gbtn { width: 100%; height: 54px; border: none; border-radius: 27px; margin-top: 16px; color: #fff; font-size: 16px; font-weight: 600;
  background: linear-gradient(90deg, #7B5CFF, #4F7BFF); cursor: pointer; }
.gbtn.tg { background: linear-gradient(90deg, #2AABEE, #1D8FD6); }
.gbtn:disabled { background: #3A3A4C; color: #9a9aa8; }
.linkbtn { background: none; border: none; color: #4F7BFF; font-size: 14px; margin-top: 12px; cursor: pointer; }
.err { color: #FF6B6B; font-size: 13px; margin-top: 8px; text-align: center; }
.credit { color: rgba(255,255,255,.4); font-size: 12px; margin: 22px 0 4px; direction: ltr; }
/* top bars */
.topbar { display: flex; align-items: center; padding: 10px 14px; background: rgba(11,11,20,.85); }
.topbar .title { flex: 1; font-size: 26px; font-weight: 700; }
.topbar.chat { padding: 8px 6px; }
.topbar .peer { flex: 1; display: flex; align-items: center; min-width: 0; }
.topbar .peer .nm { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .peer .st { font-size: 12px; color: #30D158; }
.iconbtn { background: none; border: none; color: #fff; font-size: 22px; width: 42px; height: 42px; cursor: pointer; }
.connecting { color: #8E8EA0; font-size: 12px; padding: 0 18px 4px; }
/* chat list */
.convlist { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.conv { display: flex; align-items: center; padding: 10px 18px; cursor: pointer; }
.conv:active { background: rgba(255,255,255,.05); }
.avatar { border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.conv .mid { flex: 1; min-width: 0; margin-left: 14px; }
.conv .row1 { display: flex; align-items: baseline; }
.conv .nm { flex: 1; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .tm { color: #8E8EA0; font-size: 12px; margin-left: 8px; }
.conv .pv { color: #8E8EA0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .pv.typing { color: #30D158; }
.undot { width: 10px; height: 10px; border-radius: 50%; background: #4F7BFF; margin-left: 8px; flex-shrink: 0; }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #8E8EA0; font-size: 14px; }
.empty .big { color: #fff; font-size: 18px; margin-bottom: 6px; }
/* chat */
.chatwrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.msgs { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 10px; display: flex; flex-direction: column; }
.daysep { align-self: center; color: #8E8EA0; font-size: 11px; margin: 8px 0; }
.brow { display: flex; flex-direction: column; margin-top: 3px; }
.brow.mine { align-items: flex-end; }
.brow.theirs { align-items: flex-start; }
.bubble { max-width: 290px; padding: 8px 12px; border-radius: 20px; font-size: 16px; line-height: 1.35; word-break: break-word;
  -webkit-user-select: none; user-select: none; position: relative; }
.brow.mine .bubble { background: linear-gradient(135deg, #7B5CFF, #4F7BFF); border-bottom-right-radius: 5px; }
.brow.theirs .bubble { background: #2A2A33; border-bottom-left-radius: 5px; }
.bubble.media { padding: 3px; background: none; }
.brow.mine .bubble.media { background: linear-gradient(135deg, #7B5CFF, #4F7BFF); }
.brow.theirs .bubble.media { background: #2A2A33; }
.bubble img.photo { display: block; max-width: 260px; max-height: 340px; border-radius: 17px; }
.bubble img.sticker { display: block; width: 150px; height: 150px; object-fit: contain; }
.bubble .txt { unicode-bidi: plaintext; text-align: start; white-space: pre-wrap; }
.bubble .reply { border-left: 2px solid rgba(255,255,255,.6); padding-left: 6px; margin-bottom: 4px; font-size: 12px; color: rgba(255,255,255,.8);
  max-height: 34px; overflow: hidden; }
.bubble .deleted { color: #8E8EA0; font-style: italic; font-size: 14px; }
.voice { display: flex; align-items: center; min-width: 150px; }
.voice .vbtn { width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,.2); color: #fff; font-size: 14px; margin-right: 8px; flex-shrink: 0; }
.voice .bars { display: flex; align-items: center; }
.voice .bars i { width: 3px; background: rgba(255,255,255,.8); border-radius: 2px; margin-right: 2px; }
.voice .dur { font-size: 13px; margin-left: 8px; }
.reacts { align-self: flex-end; margin-top: -4px; background: #3A3A48; border-radius: 12px; padding: 1px 7px; font-size: 13px; z-index: 2; }
.brow.theirs .reacts { align-self: flex-start; }
.mstatus { color: #8E8EA0; font-size: 11px; margin: 1px 4px 0 0; }
.typingbub { background: #2A2A33; border-radius: 18px; padding: 10px 16px; color: #8E8EA0; letter-spacing: 2px; align-self: flex-start; margin-top: 3px; }
/* reply/edit bar */
.repbar { display: flex; align-items: center; background: rgba(28,28,42,.9); padding: 6px 14px; }
.repbar .bar { width: 3px; height: 30px; background: #4F7BFF; margin-right: 8px; }
.repbar .who { color: #4F7BFF; font-size: 12px; font-weight: 600; }
.repbar .what { color: #8E8EA0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repbar .x { margin-left: auto; background: none; border: none; color: #8E8EA0; font-size: 18px; }
/* input */
.inputrow { display: flex; align-items: flex-end; padding: 8px; }
.roundbtn { width: 40px; height: 40px; border-radius: 50%; border: none; background: #1C1C2A; color: #fff; font-size: 20px; flex-shrink: 0; cursor: pointer; }
.inputmid { flex: 1; display: flex; align-items: center; background: #1C1C24; border-radius: 21px; min-height: 40px; margin: 0 8px; padding: 4px 4px 4px 14px; }
.inputmid textarea { flex: 1; background: none; border: none; outline: none; color: #fff; font-size: 16px; font-family: inherit;
  resize: none; max-height: 110px; unicode-bidi: plaintext; }
.inputmid textarea::placeholder { color: #8E8EA0; }
.sendbtn { width: 40px; height: 40px; border-radius: 50%; border: none; font-size: 18px; color: #fff; flex-shrink: 0;
  background: #3A3A44; cursor: pointer; }
.sendbtn.on { background: #30D158; }
.mini { width: 36px; height: 36px; border-radius: 50%; border: none; background: none; color: #8E8EA0; font-size: 20px; flex-shrink: 0; cursor: pointer; }
.mini.rec { color: #FF6B6B; background: rgba(255,107,107,.2); }
/* emoji / sticker panel */
.panel { height: 340px; background: #14141C; display: flex; flex-direction: column; }
.panel .tabs { display: flex; padding: 4px 12px; }
.panel .tabs .tab { padding: 6px 12px; border-radius: 12px; color: #8E8EA0; font-weight: 600; margin-right: 8px; cursor: pointer; }
.panel .tabs .tab.on { background: #30303C; color: #fff; }
.emojigrid { flex: 1; overflow-y: auto; display: flex; flex-wrap: wrap; padding: 6px; align-content: flex-start; }
.emojigrid span { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 26px; cursor: pointer; }
.stkgrid { flex: 1; overflow-y: auto; display: flex; flex-wrap: wrap; padding: 8px; align-content: flex-start; }
.stkgrid .stk { width: 76px; height: 76px; margin: 4px; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.stkgrid .stk img { max-width: 100%; max-height: 100%; }
.stkgrid .add { background: #22222C; color: #fff; font-size: 30px; cursor: pointer; }
.stkcount { color: #8E8EA0; font-size: 12px; padding: 8px 12px 0; }
/* context menu */
.menu { position: fixed; z-index: 50; background: #26262F; border-radius: 14px; padding: 6px; min-width: 200px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.menu .emojis { display: flex; padding: 4px; }
.menu .emojis span { font-size: 24px; padding: 4px; cursor: pointer; }
.menu .mi { padding: 10px 12px; font-size: 15px; border-radius: 9px; cursor: pointer; }
.menu .mi:active { background: rgba(255,255,255,.08); }
.menu .mi.danger { color: #FF6B6B; }
.overlay { position: fixed; inset: 0; z-index: 40; }
/* settings */
.setlist { flex: 1; overflow-y: auto; padding: 16px; }
.setlist h3 { font-size: 16px; margin: 20px 0 8px; }
.setrow { display: flex; align-items: center; padding: 8px 0; }
.setrow .grow { flex: 1; }
.bgs { display: flex; }
.bgs .bg { width: 46px; height: 46px; border-radius: 50%; margin-right: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; }
.obtn { border: 1px solid rgba(255,255,255,.25); background: none; color: #fff; border-radius: 20px; padding: 9px 16px; font-size: 14px; cursor: pointer; }
.obtn.danger { border-color: #FF6B6B; color: #FF6B6B; }
.panelcard { background: #1C1C2A; border-radius: 16px; margin-top: 30px; overflow: hidden; }
.panelcard .prow { display: flex; align-items: center; padding: 16px; cursor: pointer; }
.panelcard .prow .t { flex: 1; font-weight: 600; }
.panelcard .prow .s { font-size: 12px; color: #8E8EA0; font-weight: 400; }
.switch { position: relative; width: 46px; height: 28px; }
.switch input { display: none; }
.switch i { position: absolute; inset: 0; border-radius: 14px; background: #3A3A44; transition: .2s; }
.switch i:after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; }
.switch input:checked + i { background: #30D158; }
.switch input:checked + i:after { left: 21px; }
/* about */
.about-doodle { width: 260px; max-width: 80vw; border-radius: 36px; margin: 18px 0; }
.about-name { font-size: 28px; font-weight: 700; }
.about-ver { color: #8E8EA0; font-size: 13px; margin-top: 2px; }
.terms { color: #8E8EA0; font-size: 14px; line-height: 1.5; direction: ltr; }
.terms b { color: #fff; }
.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); background: #26262F; border-radius: 12px;
  padding: 10px 18px; font-size: 14px; z-index: 90; box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: 90vw; text-align: center; }
.spin { width: 22px; height: 22px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: sp 0.8s linear infinite; margin: 10px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
