:root {
  box-sizing: border-box;
  color-scheme: dark;
  --bg: #07061c;
  --panel: #141232;
  --panel2: #241c5c;
  --text: #f4f1ff;
  --mute: #9d98d4;
  --line: #322c78;
  --in: #2a2068;
  --p: #7c5cff;
  --o: #ff5b3a;
  --s: #ffd15c;
  --danger: #ff8b8b;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0ff;
  --panel: #fff;
  --panel2: #e8e9fb;
  --text: #14123f;
  --mute: #6f6ca8;
  --line: #dcdcf3;
  --in: #fff;
}
@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;
  max-width: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 480px at -10% -20%, rgba(255, 91, 58, .35), transparent 55%),
    radial-gradient(800px 520px at 110% -10%, rgba(124, 92, 255, .45), transparent 50%),
    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;
  height: 100%;
  height: 100dvh;
  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;
  background: linear-gradient(180deg, #1c1848 0%, #12102e 100%);
}
.top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.brand {
  font-weight: 750;
  font-size: 24px;
  letter-spacing: -.5px;
  flex: 1;
  line-height: 1.05;
  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); }
.ib {
  border: 0;
  background: var(--panel2);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 15px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
}
.ib svg { display: block; }
.ib:hover { filter: brightness(1.12); }
.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 { background: linear-gradient(145deg, #ff7a45, #ff3d6e); color: #fff; box-shadow: 0 6px 16px rgba(255, 61, 110, .35); }
.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: 6px; padding: 0 16px 8px; 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; overflow-y: auto; min-height: 0; }
.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: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 6px 8px 8px;
}
.nav button {
  grid-column: span 2;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--mute);
  padding: 8px 4px;
  border-radius: 12px;
  font-family: "Exo 2", Inter, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
  white-space: nowrap;
}
.nav button:nth-child(4) { grid-column: 2 / span 2; }
.nav button:nth-child(5) { grid-column: 4 / span 2; }
.nav button.on {
  color: #1a1438;
  background: var(--s);
}

.main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  position: relative;
  background: var(--bg);
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff8, transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, #fff8, transparent),
    radial-gradient(1px 1px at 40% 80%, #fff8, transparent),
    radial-gradient(1.5px 1.5px at 85% 65%, #fff8, transparent),
    radial-gradient(1px 1px at 10% 70%, #fff8, transparent),
    radial-gradient(1px 1px at 60% 50%, #fff6, transparent),
    radial-gradient(circle at 80% 100%, rgba(108, 92, 255, .25), transparent 45%);
}
.chat-live, .cover { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.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 {
  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 {
  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 { display: block; color: var(--o); font-size: 12px; }
.replybar div, .pinbar { min-width: 0; flex: 1; }
.insearch input, .profile-view input, .profile-view textarea, .profile-view select, .modal input, .modal textarea, .modal select {
  width: 100%;
  border: 0;
  background: var(--panel2);
  border-radius: 12px;
  padding: 10px 12px;
  outline: 0;
}
.msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background:
    radial-gradient(500px 280px at 20% 0%, rgba(124, 92, 255, .22), transparent 60%),
    radial-gradient(420px 240px at 100% 80%, rgba(255, 91, 58, .16), transparent 55%);
}
.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: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.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: 8px; 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: 6px; }
.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: 6px; 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);
}
.m.me {
  align-self: flex-end;
  background: linear-gradient(145deg, #8d6bff, #ff5a7a);
  color: #fff;
  border-radius: 18px 18px 5px 18px;
  box-shadow: 0 10px 26px rgba(255, 90, 122, .28);
}
.m.ghostmsg { opacity: .75; font-style: italic; }
.m .t { font-size: 10.5px; opacity: .7; text-align: right; margin-top: 2px; }
.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: 8px;
  padding: 10px 12px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  align-items: flex-end;
}
.bar textarea {
  flex: 1;
  border: 0;
  background: var(--panel2);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 24px;
  font-size: 15px;
  outline: 0;
  resize: none;
  max-height: 120px;
  line-height: 1.35;
}
.send {
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff7a45, #ff3d6e);
  color: #fff;
  font-size: 18px;
  flex: none;
  box-shadow: 0 8px 18px rgba(255, 61, 110, .4);
}
.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: 18px;
  bottom: 84px;
  z-index: 4;
  border: 0;
  background: var(--s);
  color: #3a2a00;
  font-weight: 800;
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px 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: 12px;
  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; }
.feed-card .av { width: 40px; height: 40px; }
.cover p, .hint { color: var(--mute); font-size: 13px; line-height: 1.45; }

.profile-view {
  flex: 1;
  overflow: auto;
  padding: 12px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  text-align: left;
}
.profile-view h3 { font-size: 12px; color: var(--mute); font-weight: 750; letter-spacing: .04em; text-transform: uppercase; margin-top: 6px; }
.me-head { display: flex; gap: 12px; align-items: center; text-align: left; }
.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; }
.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: 6px; font-size: 12px; color: var(--mute); font-weight: 650; text-align: left; }
.switch { display: flex !important; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; width: 100%; font-size: 14px !important; color: var(--text) !important; text-align: left; }
.switch span { flex: 1; min-width: 0; text-align: left; }
.switch input { margin-left: auto; flex: none; }
.swatches { display: flex; gap: 8px; 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: 12px;
  padding: 10px 12px;
  font-weight: 700;
}
.primary { background: linear-gradient(135deg, #ff7a45, #ff3d6e); color: #fff; box-shadow: 0 8px 18px rgba(255, 61, 110, .32); }
.ghost { background: var(--panel2); color: var(--text); }
.danger { background: transparent; color: var(--danger); }

.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: grid;
  place-items: center;
  padding: 20px 16px;
  overflow: auto;
}
.gate-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 18px 18px;
  display: grid;
  gap: 12px;
  justify-items: center;
}
.gate-card .brand { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.gate-card label { width: 100%; display: grid; gap: 6px; 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; }
.gate-error { min-height: 1.2em; color: var(--danger); width: 100%; }
.gate-actions { width: 100%; display: grid; gap: 8px; }
.gate-actions .primary, .gate-actions .ghost { width: 100%; }
.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); }
.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; }
.who-top .qr { width: 140px; height: 140px; }
.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: 10px; 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: 8px; margin: 8px 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: 8px 10px; font-size: 14px; }
.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: 35;
  width: min(320px, calc(100vw - 16px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}
.pop button { border: 0; background: transparent; font-size: 22px; width: 36px; height: 36px; border-radius: 8px; }
.pop button:hover { background: var(--panel2); }
.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; }

@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: 84px; }
@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;
}
.waves-stage {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  min-width: 0;
}
.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;
}
.wave-tools {
  position: absolute;
  right: 8px;
  bottom: 78px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.wave-tools .engage { display: flex; flex-direction: column; gap: 8px; 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: 6px; margin-top: 8px; }
.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: 4px;
  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: 60;
  background: rgba(5, 4, 16, .92);
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
}
.wave-editor[hidden] { display: none; }
.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: 10px; min-width: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row button, .wave-studio label { font-size: 14px; }
.chip-row button {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  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(74px + max(8px, 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-bottom: max(8px, env(safe-area-inset-bottom)); }
  .nav button { font-size: 12px; padding: 9px 4px; }
  .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%; }
}
