:root {
  box-sizing: border-box;
  color-scheme: dark;
  --bg: #0e1621;
  --panel: #17212b;
  --panel2: #232e3c;
  --text: #f5f5f5;
  --mute: #708499;
  --line: #0d141c;
  --in: #182533;
  --out: #2b5278;
  --p: #6c5cff;
  --o: #8f83ff;
  --s: #ffd15c;
  --danger: #e53935;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #d7e0e8;
  --panel: #fff;
  --panel2: #f4f4f5;
  --text: #222222;
  --mute: #707579;
  --line: #e6e6e6;
  --in: #fff;
  --out: #eeffde;
}
@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/exo2-cyr.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/exo2-lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html, body {
  height: 100%;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::placeholder { color: var(--mute); }
::selection { background: var(--p); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

.app {
  display: grid;
  grid-template-columns: 350px 1fr;
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--panel);
}
.app.reading { grid-template-columns: 340px minmax(0, 1fr) 300px; }
.side {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #1c1848 0%, #12102e 100%);
}
.top { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 12px; position: relative; z-index: 4; overflow: visible; }
#logo { flex: none; display: flex; line-height: 0; }
#logo svg { display: block; }
.brand {
  font-weight: 750;
  font-size: 22px;
  letter-spacing: -.4px;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  padding: 2px 0 4px;
  overflow: visible;
  white-space: nowrap;
  background: linear-gradient(90deg, #fff 20%, #ffd15c 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
:root[data-theme="light"] .brand { background: none; color: var(--text); }
.top-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: none; }
.ib {
  border: 0;
  background: transparent;
  color: #c9c4ff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
}
.ib svg { display: block; }
.ib:hover { background: rgba(108, 92, 255, .24); color: #fff; }
:root[data-theme="light"] .ib { color: #5b4fd4; }
:root[data-theme="light"] .ib:hover { background: rgba(108, 92, 255, .16); color: #3d2ea8; }
#call, #vcall { color: var(--p); }
.search-row { display: flex; gap: 8px; align-items: center; margin: 0 16px 10px; }
.search {
  flex: 1;
  margin: 0;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--panel2);
  color: var(--text);
  font-size: 14px;
  outline: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.search:focus { border-color: var(--p); box-shadow: 0 0 0 3px rgba(124, 92, 255, .28); }
.scan { color: #efeaff; }
:root[data-theme="light"] .scan { color: #5b4fd4; }
.stories {
  display: flex;
  gap: 14px;
  padding: 16px 16px 8px 18px;
  overflow-x: auto;
  overflow-y: hidden;
}
.st {
  flex: 0 0 72px;
  width: 72px;
  text-align: center;
  font-size: 11px;
  color: var(--mute);
  background: none;
  border: 0;
  padding: 0;
  overflow: visible;
}
.pl { position: relative; width: 62px; height: 62px; margin: 4px auto 6px; }
.pl .av { position: absolute; inset: 4px; width: auto; height: auto; font-size: 18px; }
.pl::after {
  content: "";
  position: absolute;
  inset: -6px -2px;
  border: 2px solid var(--o);
  border-radius: 50%;
  transform: rotate(-25deg) scaleY(.38);
  pointer-events: none;
}
.pl.fresh::after { animation: orbit-burn 2.2s ease-in-out infinite; }
.pl.seen::after { border-color: var(--line); animation: none; filter: none; }
.pl.empty::after { display: none; }
.plus {
  position: absolute;
  right: 0;
  bottom: 0;
  left: auto;
  top: auto;
  transform: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  background: var(--p);
  color: #fff;
  font-size: 14px;
  line-height: 16px;
  z-index: 3;
  padding: 0;
  display: grid;
  place-items: center;
}
.av {
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  flex: none;
  position: relative;
  background-color: #2a2068;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
.av.on::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 14px;
  height: 14px;
  background: var(--s);
  border: 2px solid var(--panel);
  clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%);
  animation: star-burn 1.7s ease-in-out infinite;
  z-index: 1;
}
.pl .av.on::after { right: -1px; top: -1px; bottom: auto; width: 12px; height: 12px; }
.chat.on .av.on::after, .chat:hover .av.on::after { border-color: var(--panel2); }
.tabs { display: flex; gap: 10px; padding: 0 16px 10px; overflow-x: auto; }
.tab {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--mute);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 20px;
}
.tab.on { background: linear-gradient(135deg, #8d6bff, #ff5b8a); color: #fff; box-shadow: 0 6px 16px rgba(124, 92, 255, .4); }
.tab.drop { outline: 2px solid var(--s); color: var(--text); }
.list { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: hidden; overscroll-behavior: none; touch-action: pan-y; }
.list.can-scroll { overflow-y: auto; overflow-x: clip; }
.chat {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}
.chat:hover, .chat.on { background: linear-gradient(90deg, rgba(124, 92, 255, .28), transparent 80%); }
.chat .av { width: 50px; height: 50px; font-size: 18px; }
.ci { flex: 1; min-width: 0; }
.row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.nm { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm { font-size: 11px; color: var(--mute); flex: none; }
.pv { font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pv.draft { color: var(--o); }
.bd {
  background: var(--s);
  color: #3a2a00;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  padding: 1px 7px;
  flex: none;
  animation: badge-burn 1.6s ease-out infinite;
}
.pin, .mute {
  font-size: 11px;
  margin-right: 4px;
  color: var(--mute);
}
.nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 4px 10px 6px;
}
.nav button {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--mute);
  padding: 11px 2px;
  border-radius: 10px;
  font-family: "Exo 2", Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav button.on { color: #c4b8ff; background: transparent; }
:root[data-theme="light"] .nav button.on { color: #5b4fd4; }

.main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  position: relative;
  background: var(--bg);
}
.chat-live, .cover { display: flex; flex-direction: column; min-height: 0; flex: 1; height: 100%; max-height: 100%; overflow: hidden; }
.head, .pinbar, .insearch, .replybar, .rec, .readonly, .pickbar, .bar { flex: none; }
.head {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px 6px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.head .ib { width: 48px; height: 48px; }
.head #more { font-size: 30px; line-height: 1; letter-spacing: .08em; }
.head-user { margin-right: 8px; }
.head .av { width: 42px; height: 42px; font-size: 16px; }
.head-user {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  color: inherit;
}
.head-user:hover .nm { color: var(--s); }
.head-txt { flex: 1; min-width: 0; }
.back { display: none; }
.live { color: var(--s); font-weight: 700; }
.typing { font-size: 12px; color: var(--s); font-weight: 650; }
.pinbar, .insearch, .replybar, .rec, .readonly, .pickbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.pinbar button, .replybar button, .insearch button, .rec button, .pickbar button {
  border: 0;
  background: var(--panel2);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
}
.pinbar span, .replybar span { color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.replybar b, .pinbar b, .pickbar b { display: block; color: var(--o); font-size: 12px; }
.pickbar { flex-wrap: wrap; border-top: 1px solid var(--line); border-bottom: 0; }
.pickbar b { flex: 1; min-width: 72px; color: var(--text); font-size: 14px; }
.pickbar button.danger { color: var(--danger); }
.m .pick-mark {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--mute);
  background: var(--bg);
}
.m.picked .pick-mark { border-color: #6c5cff; background: #6c5cff; box-shadow: inset 0 0 0 3px var(--bg); }
.st.picked .pl, .story-card.picked .pl { box-shadow: 0 0 0 3px #6c5cff; border-radius: 50%; }
.pw-row { position: relative; display: block; }
.pw-row input { padding-right: 44px; }
.pw-eye {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mute);
  display: grid;
  place-items: center;
  padding: 0;
}
.pw-eye .slash { display: none; }
.pw-eye.on .slash { display: block; }
.replybar div, .pinbar { min-width: 0; flex: 1; }
.insearch input, .profile-view input:not([type="checkbox"]), .profile-view textarea, .profile-view select, .modal input:not([type="checkbox"]), .modal textarea, .modal select {
  width: 100%;
  border: 0;
  background: var(--panel2);
  border-radius: 12px;
  padding: 10px 12px;
  outline: 0;
}
.msgs {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg);
}
.msgs.can-scroll { overflow-y: auto; overflow-x: clip; touch-action: pan-y; }
.msgs[data-wall="dusk"] { background: linear-gradient(180deg, #2a1448, #120818 70%); }
.msgs[data-wall="aurora"] { background: linear-gradient(160deg, #06281f, #10244a 60%, #1a1038); }
.msgs[data-wall="mars"] { background: linear-gradient(180deg, #3a120c, #1a0a18); }
.msgs[data-wall="ink"] { background: #07060f; }
.msgs[data-wall="feed"] { background: transparent; gap: 14px; }
.chat-live.club-feed .m.wall-post {
  max-width: 640px;
  width: 100%;
  align-self: center;
  margin: 0;
  background: var(--panel2);
  color: var(--text);
  border-radius: 18px;
  padding: 14px 14px 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}
.chat-live.club-feed .m.wall-post .pic,
.chat-live.club-feed .m.wall-post .clip {
  width: 100%;
  max-width: none;
  max-height: 460px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  margin: 8px 0 4px;
}
.chat-live.club-feed .who-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.chat-live.club-feed .who-row .av { width: 42px; height: 42px; flex: none; }
.chat-live.club-feed .m .who { color: var(--text); font-size: 15px; font-weight: 750; }
.chat-live.club-feed { width: auto; min-width: 0; }
.global-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; }
.modal h4 { margin: 14px 0 8px; font-size: 13px; color: var(--mute); font-weight: 700; }
.global-hit {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--panel2);
  color: inherit;
  border-radius: 14px;
  padding: 8px;
  margin: 0 0 6px;
  cursor: pointer;
}
.global-hit .av { width: 40px; height: 40px; flex: none; }
.walls { display: flex; gap: 8px; flex-wrap: wrap; }
.wall { width: 54px; height: 54px; border-radius: 14px; border: 2px solid transparent; }
.wall.on { border-color: var(--s); }
.wall.orbit { background: radial-gradient(circle at 30% 20%, #7c5cff, #120c30); }
.wall.dusk { background: linear-gradient(180deg, #2a1448, #120818); }
.wall.aurora { background: linear-gradient(160deg, #06281f, #1a1038); }
.wall.mars { background: linear-gradient(180deg, #3a120c, #1a0a18); }
.wall.ink { background: #07060f; }
.counts { display: flex; gap: 8px; width: 100%; }
.counts button { flex: 1; border: 0; border-radius: 14px; background: var(--panel2); padding: 8px; display: grid; }
.counts b { font-size: 18px; color: var(--s); }
.counts span { color: var(--mute); font-size: 11px; }
.slim { padding: 6px 10px; border-radius: 999px; width: auto; }
.post-box, .feed-card, .room-card { width: 100%; }
.post-box { display: grid; gap: 14px; padding: 12px 16px; }
.post-box textarea { width: 100%; border: 0; border-radius: 14px; background: var(--panel2); padding: 10px; min-height: 72px; }
.feed-card { margin: 8px 16px; padding: 12px; border-radius: 16px; background: linear-gradient(160deg, rgba(124, 92, 255, .2), rgba(255, 91, 58, .12)); display: grid; gap: 12px; }
.feed-card .who { border: 0; background: none; color: var(--s); font-weight: 800; text-align: left; padding: 0; }
.row.gap, .person .row { display: flex; gap: 10px; flex-wrap: wrap; }
.create-room { margin: 12px 16px; }
.room-edit { display: grid; gap: 8px; }
.room-edit .qr { width: 96px; height: 96px; object-fit: cover; }
.person { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; }
.day, .sys {
  align-self: center;
  font-size: 12px;
  color: var(--mute);
  background: var(--panel);
  padding: 3px 12px;
  border-radius: 12px;
  margin: 6px 0;
}
.m {
  max-width: min(75%, 460px);
  padding: 8px 22px 6px 12px;
  border-radius: 18px 18px 18px 5px;
  font-size: 15px;
  line-height: 1.4;
  background: var(--in);
  align-self: flex-start;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  overflow-wrap: anywhere;
  min-width: 0;
}
.m.me {
  align-self: flex-end;
  background: var(--out);
  color: #fff;
  border-radius: 18px 18px 5px 18px;
  box-shadow: none;
}
:root[data-theme="light"] .m.me { color: #222; }
.m.solo, .m.solo.me {
  background: transparent;
  box-shadow: none;
  padding: 2px 4px 0;
}
.m .txt.sticker {
  font-size: 72px;
  line-height: 1.05;
}
.m.ghostmsg { opacity: .75; font-style: italic; }
.m .t { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 10.5px; opacity: .7; text-align: right; margin-top: 4px; }
.m.solo .t { margin-top: 8px; }
.m .heart {
  position: static;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  opacity: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(255, 59, 92, .45));
}
.m .heart svg { display: block; width: 16px; height: 16px; }
.m.liked .re { right: 30px; }
.like-pop {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 5;
  width: 84px;
  height: 84px;
  pointer-events: none;
  filter: drop-shadow(0 8px 16px rgba(255, 45, 85, .45));
  animation: like-pop .7s ease forwards;
}
.like-pop svg { width: 84px; height: 84px; display: block; }
@keyframes like-pop {
  0% { transform: translate(-50%, -50%) scale(.35); opacity: 0; }
  35% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -62%) scale(1.05); opacity: 0; }
}
.ph-like {
  position: absolute;
  right: 6px;
  bottom: 6px;
  color: #fff;
  font-size: 14px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.ph-like.on { color: #ff5b8a; }
.shot { position: relative; }
.m .who { font-size: 12px; font-weight: 750; margin-bottom: 2px; border: 0; background: none; padding: 0; cursor: pointer; }
.m .more {
  position: absolute;
  top: 4px;
  right: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.m:hover .more, .m:focus-within .more { opacity: .75; }
.quote, .fwd {
  border-left: 2px solid var(--s);
  padding: 2px 0 4px 8px;
  margin-bottom: 4px;
  font-size: 12.5px;
  opacity: .9;
}
.quote b, .fwd { display: block; color: var(--s); font-size: 11px; }
.re {
  position: absolute;
  bottom: -11px;
  right: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
  padding: 0 6px;
  cursor: pointer;
}
.m.me .re { background: #2a246e; }
.voice { display: flex; align-items: center; gap: 8px; min-width: 190px; cursor: pointer; }
.voice .play {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .14);
  color: inherit;
  flex: none;
}
.voice .wave {
  position: relative;
  flex: 1;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 5px);
  opacity: .55;
}
.voice .wave b {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 213, 74, .35);
}
.voice audio { display: none; }
.clip {
  display: block;
  width: min(260px, 70vw);
  max-height: 220px;
  border-radius: 12px;
  margin-bottom: 4px;
  background: #000;
}
.pic { display: block; max-width: 240px; max-height: 240px; border-radius: 12px; margin-bottom: 4px; cursor: zoom-in; }
.file {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(0, 0, 0, .15);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 4px;
}
.file button { border: 0; background: var(--s); color: #3a2a00; border-radius: 8px; padding: 4px 8px; font-weight: 700; }
.bar {
  display: flex;
  gap: 4px;
  padding: 8px 8px 4px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  align-items: flex-end;
  position: relative;
  z-index: 2;
}
.bar .ib { width: 54px; height: 54px; }
.bar textarea {
  flex: 1;
  border: 0;
  background: var(--panel2);
  color: var(--text);
  min-height: 54px;
  padding: 15px 18px;
  border-radius: 27px;
  font-size: 16px;
  outline: 0;
  resize: none;
  max-height: 140px;
  line-height: 1.35;
}
.send {
  border: 0;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #6c5cff;
  color: #fff;
  flex: none;
  box-shadow: none;
  display: grid;
  place-items: center;
  padding: 0;
}
.send svg { display: block; }
.send:disabled { opacity: .45; cursor: default; }
.rec .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5470;
  box-shadow: 0 0 10px #ff5470;
  animation: badge-burn 1.2s infinite;
}
.jump {
  position: absolute;
  right: 16px;
  bottom: 84px;
  z-index: 4;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--p);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
}
.empty, .empty-msgs {
  margin: auto;
  text-align: center;
  color: var(--mute);
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 24px;
}
.empty h2, .cover h2 { font-weight: 600; color: var(--text); letter-spacing: -.3px; }
.cover { align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 8px; overflow: auto; }
.cover.reading { align-items: stretch; justify-content: flex-start; text-align: left; }
.cover.reading .profile-stage { width: min(640px, 100%); margin: 0 auto; justify-items: stretch; }
.dock {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 22px 16px;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #1c1848 0%, #12102e 100%);
}
.dock h2 { font-size: 20px; font-weight: 700; }
.who-row { display: flex; gap: 10px; align-items: center; text-align: left; }
button.who-row { border: 0; background: none; color: inherit; width: 100%; cursor: pointer; padding: 0; }
body:has(#gate:not([hidden])) .notices { display: none; }
.feed-card .av { width: 40px; height: 40px; }
.cover p, .hint { color: var(--mute); font-size: 13px; line-height: 1.45; }

.profile-view {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: none;
  touch-action: pan-y;
  padding: 12px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  text-align: left;
}
.profile-view h3 { font-size: 12px; color: var(--mute); font-weight: 750; letter-spacing: .04em; text-transform: uppercase; margin-top: 18px; }
.me-head { display: flex; gap: 22px; align-items: flex-start; text-align: left; }
.me-head > div { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding-top: 6px; }
.me-head .pav { margin: 0; width: 72px; height: 72px; flex: none; }
.me-head .nm { font-size: 18px; font-weight: 750; }
.me-head .handle, .me-head .live-line, .me-head .photo-hint { text-align: left; }
.me-head .photo-hint { margin-top: 4px; line-height: 1.35; }
.me-head .slim { margin-top: 8px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery img, .shot img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.shot { border: 0; padding: 0; background: none; border-radius: 10px; position: relative; cursor: pointer; }
.my-post { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); }
button.my-post, button.post-body { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.my-post p { white-space: pre-wrap; }
.own-preview { width: 100%; max-height: 320px; object-fit: cover; border-radius: 14px; display: block; margin: 8px 0; }
.own-piece .modal-actions { flex-wrap: wrap; }
.pav {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 32px;
  font-weight: 750;
  position: relative;
  margin: 8px auto 0;
  background-color: #2a2068;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
.pav.on::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  background: var(--s);
  border: 2px solid var(--panel);
  clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%);
  animation: star-burn 1.7s ease-in-out infinite;
}
.live-line { text-align: left; color: var(--s); font-weight: 750; font-size: 13px; }
.profile-view label, .modal label { display: grid; gap: 8px; font-size: 12px; color: var(--mute); font-weight: 650; text-align: left; }
.switch {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  font-size: 15px !important;
  color: var(--text) !important;
  text-align: left;
}
.switch span {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}
.switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 46px;
  height: 26px;
  margin: 0 0 0 auto;
  padding: 0;
  flex: 0 0 46px;
  border: 0;
  border-radius: 999px;
  background: #3e546a;
  position: relative;
}
.switch input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
}
.switch input[type="checkbox"]:checked { background: var(--p); }
.switch input[type="checkbox"]:checked::after { transform: translateX(20px); }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; }
.swatches button.on { border-color: #fff; }
.primary, .ghost, .danger {
  border: 0;
  border-radius: 10px;
  min-height: 46px;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 15px;
}
.primary { background: var(--p); color: #fff; box-shadow: none; }
.primary:hover { background: #7d6dff; }
.ghost { background: rgba(108, 92, 255, .16); color: #efeaff; }
.ghost:hover { background: rgba(108, 92, 255, .26); }
:root[data-theme="light"] .ghost { background: rgba(108, 92, 255, .12); color: #3d2ea8; }
.danger { background: var(--danger); color: #fff; }
.call-actions { justify-content: center; flex-wrap: wrap; }
.call-actions button { border-radius: 999px; min-width: 108px; }

.story-card {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 10px 16px;
}
.story-card:hover { background: var(--panel2); }
.story-card .pl { width: 52px; height: 52px; margin: 0; flex: none; }
.story-card p { color: var(--mute); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.overlay, .story-layer, .boot {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(6, 5, 24, .72);
  display: grid;
  place-items: center;
  padding: 16px;
}
.story-layer { background: rgba(5, 4, 20, .88); z-index: 40; }
.boot { background: var(--bg); z-index: 50; text-align: center; gap: 12px; }
.gate {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  overflow: hidden;
}
.gate-card {
  width: min(420px, 100%);
  max-height: 100%;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
#gate-logo { display: flex; justify-content: center; flex: none; }
.gate-card .brand { text-align: center; flex: none; }
.gate-card .brand { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.gate-card label { width: 100%; display: grid; gap: 8px; font-size: 12px; color: var(--mute); font-weight: 650; }
.gate-card h3, .gate-card .hint, .code-slip { width: 100%; }
.gate-lang { display: grid; gap: 6px; font-size: 12px; color: var(--mute); font-weight: 650; }
.gate-lang select, .gate-card input, .gate-card textarea {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
}
.gate-card input:focus, .gate-card textarea:focus, .gate-lang select:focus { border-color: var(--p); }
.gate-card .modal-tabs { width: 100%; }
.gate-card .modal-tabs button { flex: 1; text-align: center; border-radius: 999px; padding: 8px 10px; }
.gate-card .modal-tabs button.on { background: var(--panel2); }
#gate-fields {
  width: 100%;
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.gate-card .gate-lang, .gate-card .modal-tabs, .gate-error { flex: none; }
.gate-error { min-height: 0; color: var(--danger); width: 100%; }
.gate-error:empty { display: none; }
.gate-actions {
  width: 100%;
  display: grid;
  gap: 12px;
  flex: none;
  background: var(--panel);
}
.gate-actions .primary, .gate-actions .ghost { width: 100%; }
.text-link {
  border: 0;
  background: transparent;
  color: var(--s);
  font-weight: 650;
  padding: 6px 0 0;
  width: 100%;
  text-align: center;
}
.recovery {
  background: rgba(255, 106, 61, .12);
  border: 1px solid rgba(255, 106, 61, .45);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}
.code-slip {
  width: 100%;
  background: var(--panel2);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}
.code-slip b { display: block; letter-spacing: .28em; font-size: 22px; margin-top: 6px; }
.setup-photo {
  width: 84px;
  height: 84px;
  justify-self: center;
  border-radius: 50%;
  border: 0;
  background: var(--panel2);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 28px;
}
.setup-photo img { width: 100%; height: 100%; object-fit: cover; }
:root[data-theme="light"] body {
  background:
    radial-gradient(900px 480px at -10% -20%, rgba(255, 91, 58, .16), transparent 55%),
    radial-gradient(800px 520px at 110% -10%, rgba(124, 92, 255, .18), transparent 50%),
    var(--bg);
}
:root[data-theme="light"] .side { background: linear-gradient(180deg, #fff, #f4f2ff); }
:root[data-theme="light"] .dock { background: #fff; }
.lang-select select { min-height: 36px; font-size: 14px; font-weight: 650; }
.handle { text-align: left; font-weight: 750; font-size: 14px; color: var(--mute); }
.photo-hint { text-align: left; margin: 0; }
.qr {
  width: 112px;
  height: 112px;
  margin: 0;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
}
.pav { cursor: pointer; box-shadow: 0 10px 24px rgba(124, 92, 255, .35); }
.pav.sealed { cursor: default; pointer-events: none; }
.closed-note { margin: 8px 0 0; color: var(--mute); font-weight: 700; }
.person-hit { border-left: 3px solid var(--s); }
.person-hit .nick { color: var(--s); font-size: 12px; font-weight: 750; }
.facts { display: grid; gap: 8px; margin: 8px 0; }
.facts div { background: var(--panel2); border-radius: 12px; padding: 8px 10px; }
.facts dt { color: var(--mute); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.facts dd { font-size: 15px; }
.person-page.modal {
  width: min(760px, 100%);
  max-height: none;
  min-height: 100%;
  margin: 0 auto;
  border-radius: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: none;
  padding: 64px 22px 48px;
}
.overlay:has(.person-page) {
  display: block;
  padding: 0;
  overflow: auto;
  background: var(--bg);
  place-items: stretch;
}
.person-page .me-head { width: 100%; }
.person-page .me-head .pav { width: 96px; height: 96px; margin: 0; font-size: 32px; }
.person-page .me-head .nm, .person-page .me-head .handle { text-align: left; }
.person-page .nm { font-size: 26px; font-weight: 750; }
.person-page h3 { font-size: 12px; color: var(--mute); font-weight: 750; letter-spacing: .04em; text-transform: uppercase; margin: 22px 0 10px; }
.person-page .qr { width: 112px; height: 112px; margin-top: 8px; }
.social-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.wave-tile b {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-actions .primary { flex: 1; }
.scan-card { display: grid; gap: 10px; justify-items: center; }
.scan-frame {
  width: min(100%, 320px);
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 3px var(--s), 0 16px 40px rgba(255, 209, 92, .25);
}
.scan-frame video { width: 100%; height: 100%; object-fit: cover; }
.profile-stage { width: min(460px, 100%); display: grid; gap: 16px; justify-items: center; }
.profile-stage.sheet, .cover.reading .profile-stage.sheet { width: min(640px, 100%); justify-items: stretch; text-align: left; }
.modal, .story-card-view, .call-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
  max-height: min(86vh, 720px);
  overflow: auto;
}
.modal h3, .call-card h3 { font-size: 18px; font-weight: 650; margin-bottom: 10px; }
.modal-tabs, .modal-actions, .call-actions { display: flex; gap: 12px; margin: 12px 0; }
.modal-tabs button, .person, .menu button {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.modal-tabs button { padding: 6px 10px; border-radius: 999px; color: var(--mute); font-weight: 700; }
.modal-tabs button.on { background: var(--p); color: #fff; }
.person {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border-radius: 12px;
}
.person:hover, .menu button:hover { background: var(--panel2); }
.person .av { width: 36px; height: 36px; }
.checks { display: grid; gap: 4px; max-height: 240px; overflow: auto; }
.menu {
  position: fixed;
  z-index: 45;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 210px;
  padding: 6px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .35);
}
.menu button { display: block; width: 100%; border-radius: 10px; padding: 11px 12px; font-size: 15px; }
.menu button.danger { color: var(--danger); }
.reacts { display: flex; gap: 4px; padding: 4px; }
.reacts button { border: 0; background: var(--panel2); border-radius: 10px; padding: 4px 8px; }

.story-frame {
  width: min(420px, 100%);
  height: min(78vh, 720px);
  border-radius: 24px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  color: #fff;
  overflow: hidden;
}
.bars { display: flex; gap: 4px; }
.bars i { flex: 1; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.bars i em { display: block; height: 100%; width: 0; background: #fff; }
.bars i.done em { width: 100%; }
.bars i.now em { animation: load 5.6s linear forwards; }
.story-top { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.story-who { display: flex; align-items: center; gap: 10px; flex: 1; border: 0; background: none; color: inherit; padding: 0; text-align: left; cursor: pointer; }
.story-top .av { width: 36px; height: 36px; }
.story-body { flex: 1; display: grid; place-items: center; text-align: center; font-size: 26px; font-weight: 650; letter-spacing: -.4px; line-height: 1.25; padding: 16px; }
.story-body img { max-width: 100%; max-height: 46vh; border-radius: 16px; object-fit: cover; }
.story-actions { display: flex; gap: 8px; }
.story-top, .story-actions, .bars { position: relative; z-index: 2; }
.hit {
  position: absolute;
  top: 48px;
  bottom: 64px;
  width: 35%;
  border: 0;
  background: transparent;
}
.hit.right { right: 0; }
.hit.left { left: 0; }
.call-card { text-align: center; display: grid; justify-items: center; gap: 8px; width: min(520px, 100%); }
.call-card .av { width: 92px; height: 92px; font-size: 36px; }
.call-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #07061a;
  border-radius: 16px;
  overflow: hidden;
}
.call-stage video { width: 100%; height: 100%; object-fit: cover; background: #07061a; }
.call-stage .local-pip {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 28%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .35);
  background: #111;
}
.person-card .who-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; text-align: left; gap: 6px 12px; margin-bottom: 8px; }
.person-card .who-top .pav { margin: 0; }
.person-card .who-top .counts, .person-card .who-top .facts, .person-card .who-top .gallery, .person-card .who-top h3, .person-card .who-top .qr, .person-card .my-post { width: 100%; }
.person-card .pav { margin: 0 auto; }
.mini-stories { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.mini-stories button { border: 0; background: none; color: var(--mute); font-size: 11px; width: 64px; padding: 0; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.media-grid img, .media-grid video {
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
  cursor: pointer;
}
.media-list { display: grid; gap: 6px; }
.media-list a, .media-list .voice {
  background: var(--panel2);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--text);
  text-decoration: none;
  word-break: break-all;
}
.pulse-ring { animation: orbit-burn 1.4s ease-in-out infinite; }
.pop {
  position: fixed;
  z-index: 80;
  width: min(360px, calc(100vw - 16px));
  max-height: min(380px, 52vh);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}
.pop-tabs { display: flex; gap: 6px; flex: none; }
.pop-tabs button { width: auto; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--mute); }
.pop-tabs button.on { background: var(--p); color: #fff; }
.pop-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; overflow: auto; min-height: 0; }
.pop button { border: 0; background: transparent; font-size: 22px; width: 36px; height: 40px; border-radius: 8px; }
.pop-grid button { width: 100%; }
.pop.stickers .pop-grid { grid-template-columns: repeat(4, 1fr); }
.pop.stickers .pop-grid button { height: 72px; font-size: 46px; }
.pop button:hover { background: var(--panel2); }
.pop .pop-tabs { gap: 8px; }
.pop .pop-tabs button {
  width: auto;
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  font-size: 14px;
  line-height: 34px;
  white-space: nowrap;
  overflow: visible;
}
.help {
  position: relative;
  flex: none;
  display: flex;
}
.help[hidden] { display: none; }
#help-fab {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.03em;
  white-space: nowrap;
}
.help-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  width: min(300px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .4);
  text-align: left;
}
.help-card h3 { font-size: 16px; font-weight: 750; margin-bottom: 8px; }
.help-card p { color: var(--text); font-size: 14px; line-height: 1.5; }
.help-card b { color: var(--s); }
body:has(#gate:not([hidden])) .help { display: none; }
body:has(#wave-editor:not([hidden])) .help { display: none; }
.tab-back {
  position: fixed;
  z-index: 82;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(108, 92, 255, .2);
  color: #efeaff;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: none;
}
.tab-back:hover { background: rgba(108, 92, 255, .34); }
:root[data-theme="light"] .tab-back {
  background: #fff;
  color: #3d2ea8;
  border: 1px solid rgba(61, 46, 168, .28);
  box-shadow: 0 2px 10px rgba(40, 20, 80, .16);
}
:root[data-theme="light"] .tab-back:hover { background: #f3f0ff; }
body:has(#tab-back:not([hidden])):not(:has(.app.open)):not(:has(#gate:not([hidden]))):not(:has(#boot:not([hidden]))) .app.waves-mode .wave-tabs { left: 64px; }
body:has(#tab-back:not([hidden])):not(:has(.app.open)):not(:has(#gate:not([hidden]))):not(:has(#boot:not([hidden]))) .top { padding-left: 58px; }
body:has(.app.open) .tab-back,
body:has(#gate:not([hidden])) .tab-back,
body:has(#boot:not([hidden])) .tab-back { display: none !important; }
.notices {
  position: fixed;
  z-index: 78;
  top: 58px;
  left: 12px;
  width: min(320px, calc(100vw - 24px));
  display: grid;
  gap: 8px;
}
.notice {
  display: grid;
  gap: 2px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  padding: 10px 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}
.notice b { font-size: 14px; }
.notice span { color: var(--mute); font-size: 13px; }
.person-open {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 12px;
  align-items: center;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  padding: 0;
}
.alert-row { padding-left: 0; padding-right: 0; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  z-index: 60;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}
mark { background: var(--s); color: #3a2a00; border-radius: 3px; padding: 0 1px; }
.lightbox { max-width: min(92vw, 900px); max-height: 86vh; border-radius: 16px; }
.photo-view {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #000;
  display: grid;
  place-items: center;
}
.photo-view[hidden] { display: none; }
.photo-view img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.photo-view button {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 22px;
}
.nick-hint { margin: -6px 0 0; color: var(--danger); }
.nick-hint:empty { display: none; }

@keyframes star-burn {
  0%, 100% { filter: drop-shadow(0 0 1px #fff6) drop-shadow(0 0 3px #ffd54a); }
  50% { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 8px #ffd54a); }
}
@keyframes orbit-burn {
  0%, 100% { filter: drop-shadow(0 0 1px #ff6a3d); }
  50% { filter: drop-shadow(0 0 3px #ff6a3d) drop-shadow(0 0 8px #ff6a3d); }
}
@keyframes badge-burn {
  0% { box-shadow: 0 0 0 0 rgba(255, 213, 74, .7); }
  70% { box-shadow: 0 0 0 8px rgba(255, 213, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 213, 74, 0); }
}
@keyframes wave { from { background-position: 0 0; } to { background-position: 24px 0; } }
@keyframes load { from { width: 0; } to { width: 100%; } }

.app.waves-mode .side > :not(.nav) { display: none !important; }
.app.waves-mode .side {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: auto;
  border: 0;
  background: rgba(10, 8, 28, .94);
}
.app.waves-mode { --nav-h: 52px; }
@media (min-width: 761px) {
  .app.waves-mode .nav { display: flex; }
  .app.waves-mode .nav button { flex: 1; grid-column: auto; font-size: 14px; }
  .app.waves-mode { --nav-h: 52px; }
}
.app.waves-mode .main {
  display: flex !important;
  grid-column: 1 / -1;
  min-height: 0;
  height: 100dvh;
  padding-bottom: 0;
}
.app.waves-mode .waves { bottom: var(--nav-h); }
.app.waves-mode .nav { width: 100%; }
.main { position: relative; min-width: 0; min-height: 0; }
.waves {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  background: #05040f;
  min-height: 0;
}
.wave-tabs, .saved-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
}
.wave-tabs {
  position: absolute;
  z-index: 6;
  top: 12px;
  left: 12px;
  right: 104px;
  overflow-x: auto;
  touch-action: pan-x;
}
.wave-tabs button, .saved-tabs button {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-weight: 700;
}
.saved-tabs {
  overflow-x: auto;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  touch-action: pan-x;
}
.saved-tabs button { background: var(--panel2); color: var(--mute); }
.wave-tabs button.on, .saved-tabs button.on { background: var(--p); color: #fff; }
.waves-stage {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  min-width: 0;
}
.waves-stage.liked { scroll-snap-type: none; padding: 58px 12px 18px; }
.liked-list { display: grid; gap: 12px; }
.liked-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  color: inherit;
  background: var(--panel);
  border: 0;
  border-radius: 16px;
  padding: 10px;
}
.liked-card .wave-tile { width: 72px; flex: none; }
.liked-card p { color: var(--mute); margin-top: 4px; }
.wave {
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: grid;
  place-items: center;
}
.wave-frame {
  position: relative;
  height: 100%;
  width: min(100%, calc(100% * 9 / 16));
  max-width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  overflow: hidden;
}
.wave-frame video, .wave-frame .wave-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}
.wave-shade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 14px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .72));
  color: #fff;
}
.wave-author { display: flex; align-items: center; gap: 8px; }
.wave-author .who { color: #fff; font-weight: 750; border: 0; background: none; padding: 0; cursor: pointer; }
.wave-follow {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  background: #ff2d55;
  color: #fff;
  font-weight: 750;
}
.wave-follow.on { background: rgba(255, 255, 255, .18); }
.wave-caption { margin: 8px 0 0; font-size: 14px; }
.wave-onvideo {
  position: absolute;
  left: 12px;
  right: 64px;
  top: 18%;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .65);
  pointer-events: none;
  white-space: pre-wrap;
}
.wave-tools {
  position: absolute;
  right: 8px;
  bottom: 78px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.wave-tools .engage { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.wave-tools .engage button, .engage button {
  border: 0;
  background: rgba(255, 255, 255, .12);
  color: inherit;
  border-radius: 999px;
  padding: 6px 8px;
  font-weight: 700;
}
.engage { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.engage button.on, .like.on { background: #ff2d55; color: #fff; }
.wave-drag {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: linear-gradient(90deg, #7c5cff, #ff5b8a);
  color: #fff;
  font-weight: 800;
  letter-spacing: -.02em;
  box-shadow: 0 8px 24px rgba(124, 92, 255, .45);
  touch-action: none;
  cursor: grab;
}
.waves-rail {
  overflow: auto;
  padding: 10px 8px 70px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(8, 6, 24, .55);
  border-left: 1px solid rgba(255, 255, 255, .06);
}
.drop-person {
  border: 0;
  background: transparent;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 4px;
  border-radius: 14px;
}
.drop-person .av { width: 48px; height: 48px; }
.drop-person.hot { outline: 2px solid #ffd15c; }
.wave-make {
  position: absolute;
  right: 104px;
  bottom: 16px;
  z-index: 5;
  border: 0;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  color: #1a1438;
  font-size: 30px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.wave-editor {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: #000;
  display: block;
  padding: 0;
  overflow: hidden;
}
.wave-editor[hidden] { display: none; }
body:has(#wave-editor:not([hidden])) .help { display: none; }
.ig-edit, .ig-share {
  position: absolute;
  inset: 0;
  background: #000;
  color: #fff;
}
.ig-edit video, .ig-share video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.ig-share video { position: static; width: 92px; height: 128px; border-radius: 12px; flex: none; }
.ig-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent);
}
.ig-top button, .ig-side button, .ig-dock button {
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 750;
}
.ig-top > button:first-child { font-size: 26px; width: 40px; height: 40px; }
.ig-next {
  background: #6c5cff !important;
  color: #fff;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
}
.ig-side {
  position: absolute;
  z-index: 2;
  right: 8px;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ig-side button {
  width: 64px;
  min-height: 44px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .45);
  font-size: 12px;
  line-height: 1.15;
  padding: 6px 4px;
}
.wave-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ig-sheet { max-height: 46vh; overflow: auto; }
.ig-label, .wave-title {
  position: absolute;
  transform: translate(-50%, -50%);
  max-width: 78%;
  margin: 0;
  white-space: pre-wrap;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .7);
  word-break: break-word;
}
.wave-title { pointer-events: none; z-index: 2; }
.ig-label {
  z-index: 2;
  touch-action: none;
  pointer-events: auto;
  cursor: grab;
  padding: 4px 8px;
  border-radius: 10px;
}
.ig-label.on { outline: 2px dashed rgba(255, 255, 255, .9); cursor: grabbing; }
.ig-swatches, .ig-align { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ig-swatches button, .ig-align button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
}
.ig-swatches button.on, .ig-align button.on { border-color: #fff; }
.ig-align button { width: auto; border-radius: 999px; padding: 0 10px; background: rgba(255, 255, 255, .16); color: #fff; }
.ig-sheet textarea {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  resize: none;
  font: inherit;
}
.ig-sheet {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 72px;
  padding: 12px 12px 8px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .72) 28%);
  display: grid;
  gap: 8px;
}
.ig-sheet label { display: grid; gap: 6px; color: #fff; font-size: 13px; }
.ig-sheet input[type="text"], .ig-sheet input:not([type="range"]) {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
}
.ig-looks { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.ig-looks button {
  border: 0;
  background: transparent;
  color: #fff;
  display: grid;
  justify-items: center;
  gap: 4px;
  flex: none;
  font-size: 11px;
}
.ig-looks i {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: block;
  background: linear-gradient(160deg, #7ec8ff, #ff8fab 55%, #ffd56a);
  border: 2px solid transparent;
}
.ig-looks button.on i { border-color: #fff; }
.ig-dock {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
}
.ig-dock button {
  flex: 1;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  font-size: 14px;
}
.ig-share { display: flex; flex-direction: column; padding: calc(8px + env(safe-area-inset-top)) 16px 16px; }
.ig-share .ig-top { position: static; background: none; padding: 8px 0 16px; }
.ig-share-row { display: flex; gap: 14px; align-items: flex-start; }
.ig-share textarea {
  flex: 1;
  min-height: 128px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 16px;
  resize: none;
  outline: 0;
}
.ig-share .primary { margin-top: auto; width: 100%; border-radius: 12px; padding: 14px; }
.wave-studio {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 16px;
  background: var(--panel);
  border-radius: 20px;
  padding: 16px;
}
.wave-studio video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #000;
  border-radius: 16px;
  max-height: 72dvh;
}
.studio-tools { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.wave-studio label { display: grid; gap: 8px; }
.wave-studio label input + input { margin-top: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-row button, .wave-studio label { font-size: 14px; }
.chip-row button {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--panel2);
  color: var(--text);
}
.chip-row button.on { background: var(--s); color: #1a1438; }
.wave-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.wave-tile {
  border: 0;
  padding: 0;
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  overflow: hidden;
  background: #120e30;
  position: relative;
  color: #fff;
}
.wave-tile img { width: 100%; height: 100%; object-fit: cover; }
.wave-ghost {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  color: #1a1438;
  font-weight: 800;
}
.empty-wave { color: #fff; padding: 24px; text-align: center; }
.comment-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow: auto; margin: 8px 0; }
.wave-card {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 0;
  background: rgba(0, 0, 0, .25);
  color: inherit;
  border-radius: 12px;
  padding: 6px;
}
.wave-card img { width: 42px; height: 74px; object-fit: cover; border-radius: 8px; }
@media (max-width: 760px) {
  .waves { grid-template-columns: minmax(0, 1fr) 72px; }
  .wave-frame { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
  .app.waves-mode { --nav-h: calc(58px + env(safe-area-inset-bottom)); }
  .wave-make { right: 84px; bottom: 18px; width: 52px; height: 52px; font-size: 28px; }
  .wave-studio { grid-template-columns: 1fr; }
  .wave-studio video { max-height: 46dvh; }
  .drop-person .av { width: 40px; height: 40px; }
}

@media (hover: none) {
  .m .more { opacity: .65; }
}
@media (max-width: 760px) {
  .app, .app.reading { grid-template-columns: 1fr; }
  .dock { display: none !important; }
  .main { display: none; }
  .app.open .side { display: none; }
  .app.open .main { display: flex; }
  .back { display: grid; }
  input, textarea, select { font-size: 16px; }
  .nav { padding: 4px 12px max(2px, env(safe-area-inset-bottom)); }
  .nav button { font-size: 13px; padding: 8px 1px; }
  html, body {
    position: fixed;
    inset: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: pan-y;
  }
  .app, .side, .main, .cover, .chat-live, .msgs, .list, .profile-view {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
  }
  .app { height: 100%; }
  .profile-view input:not([type="checkbox"]), .profile-view textarea, .profile-view select, .profile-view img, .profile-view button { max-width: 100%; min-width: 0; }
  .app.open, .app.open .main, .app.open .chat-live {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    touch-action: none;
  }
  .app.open .main { position: relative; }
  .app.open .chat-live {
    position: absolute;
    inset: 0;
    z-index: 20;
    height: auto;
    max-height: none;
    width: auto;
  }
  .app.open .head,
  .app.open .bar,
  .app.open .pinbar,
  .app.open .saved-tabs,
  .app.open .replybar,
  .app.open .rec,
  .app.open .readonly,
  .app.open .insearch {
    position: relative;
    top: auto;
    flex: none;
    touch-action: none;
  }
  .app.open .msgs {
    min-height: 0;
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior: none;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }
  html, body, .app, .side, .main, .chat-live { touch-action: none; }
  #list, #profile, .cover, .waves-stage, .pop-grid { touch-action: pan-y; overscroll-behavior: none; }
  .bar { gap: 2px; padding: 8px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bar textarea { min-height: 54px; padding: 15px 16px; font-size: 17px; }
  .bar .ib { width: 52px; height: 52px; }
  .send { width: 54px; height: 54px; }
  .m img, .m video, .m .file, .pic, .clip { max-width: 100%; }
  .head { gap: 2px; padding: 6px 4px 6px 2px; }
  #call, #vcall, #more, .back { display: grid; flex: none; }
  .pop { left: 0 !important; right: 0; top: auto !important; bottom: 0 !important; width: 100%; max-height: 48vh; border-radius: 16px 16px 0 0; }
  .switch span { font-size: 15px; }
  .gate {
    align-items: stretch;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    touch-action: pan-y;
  }
  .gate-card { width: 100%; padding: 14px 14px 12px; gap: 8px; border-radius: 18px; }
  #gate-logo svg { width: 48px; height: 48px; }
  .gate-card, .app, .side, .main { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .bd, .av.on::after, .pl.fresh::after, .pav.on::after, .bars i.now em { animation: none; }
  .bars i.now em { width: 100%; }
}
