/* Chat. web — black and white, iOS 26 liquid glass. */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface2: #f0f0f2;
  --card: #ffffff;
  --pressed: #e9e9ec;
  --hairline: rgba(0, 0, 0, 0.12);
  --ink: #0f0f12;
  --muted: #8e8e93;
  --danger: #ff3b30;
  --bubble-in: #efeff1;
  --bubble-out: #0f0f12;
  --on-out: #ffffff;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-edge2: rgba(0, 0, 0, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  --radius: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #000000;
    --surface2: #1c1c1e;
    --card: #1c1c1e;
    --pressed: #2c2c2e;
    --hairline: rgba(255, 255, 255, 0.14);
    --ink: #f5f5f7;
    --muted: #8e8e93;
    --bubble-in: #1f1f22;
    --bubble-out: #f5f5f7;
    --on-out: #0f0f12;
    --glass: rgba(30, 30, 32, 0.55);
    --glass-edge: rgba(255, 255, 255, 0.22);
    --glass-edge2: rgba(255, 255, 255, 0.05);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #000000; --surface2: #1c1c1e; --card: #1c1c1e; --pressed: #2c2c2e;
  --hairline: rgba(255, 255, 255, 0.14); --ink: #f5f5f7; --muted: #8e8e93; --bubble-in: #1f1f22;
  --bubble-out: #f5f5f7; --on-out: #0f0f12; --glass: rgba(30, 30, 32, 0.55);
  --glass-edge: rgba(255, 255, 255, 0.22); --glass-edge2: rgba(255, 255, 255, 0.05); --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--surface);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif, "Segoe UI Symbol", "Cambria Math", "Noto Sans Math", "STIX Two Math", "Apple Symbols", "Segoe UI Emoji", "Apple Color Emoji";
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: var(--ink); }
a { color: inherit; }
img { display: block; }
.hidden { display: none !important; }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 0.8px solid var(--glass-edge);
  box-shadow: var(--shadow), inset 0 -1px 0 var(--glass-edge2);
}
.press { transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s; }
.press:active { transform: scale(0.9); }
.fade:active { opacity: 0.4; }

/* ---------- Layout ---------- */
#app { min-height: 100%; }
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; position: relative; }
.page { max-width: 680px; margin: 0 auto; padding: 0 0 120px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: linear-gradient(var(--surface) 30%, transparent);
}
.topbar h1 { flex: 1; margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -0.5px; }
.topbar .title { flex: 1; text-align: center; font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wordmark { font-size: 34px; font-weight: 900; letter-spacing: -1.5px; }
.circle-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
}
.circle-btn svg { width: 21px; height: 21px; }
.btn-group { display: flex; border-radius: 999px; padding: 0 4px; }
.btn-group .circle-btn { box-shadow: none; border: 0; background: none; }

/* Floating tab bar (phones) */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 12px);
  z-index: 50; display: flex; gap: 2px; padding: 5px; border-radius: 999px; width: min(440px, calc(100% - 32px));
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px;
  border-radius: 999px; color: var(--muted); font-size: 11px; position: relative; transition: background 0.3s, color 0.3s;
}
.tabbar button svg { width: 25px; height: 25px; }
.tabbar button.on { color: var(--ink); }
/* The glass lens that slides between tabs (drag along the bar like on the phone). */
.tabbar .lens {
  position: absolute; top: 5px; bottom: 5px; left: 0; border-radius: 999px; background: var(--pressed); z-index: 0; pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.3s, box-shadow 0.25s;
}
.tabbar.dragging .lens { transition: none; transform-origin: center; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.tabbar button > svg, .tabbar button > span:not(.badge) { position: relative; z-index: 1; }
.tabbar .badge { z-index: 2; }
.tabbar { touch-action: none; transition: width 0.4s cubic-bezier(0.34, 1.3, 0.64, 1), padding 0.3s, bottom 0.3s; }
.tabbar button span:not(.badge) { transition: opacity 0.2s, max-height 0.3s; max-height: 16px; overflow: hidden; }
/* Scrolling down shrinks the bar and hides the labels (iOS 26). */
.tabbar.compact { width: min(300px, calc(100% - 96px)); }
.tabbar.compact button { padding: 6px 0; }
.tabbar.compact button span:not(.badge) { opacity: 0; max-height: 0; }
.badge {
  position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}

/* Sidebar (wide screens) */
.sidebar { display: none; }
@media (min-width: 900px) {
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; width: 244px; flex: none; position: sticky; top: 0; height: 100vh;
    padding: 26px 12px; border-right: 1px solid var(--hairline);
  }
  .sidebar .wordmark { padding: 0 14px 22px; }
  .sidebar button { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; font-size: 16px; text-align: left; position: relative; }
  .sidebar button:hover { background: var(--surface2); }
  .sidebar button.on { font-weight: 700; background: var(--pressed); }
  .sidebar button svg { width: 26px; height: 26px; }
  .sidebar .badge { position: static; margin-left: auto; }
  .page { padding-bottom: 40px; }
}

/* ---------- Common pieces ---------- */
.avatar {
  border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(160deg, #9a9aa1, #5d5d63); color: #fff; font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.ring { width: max-content; margin: 0 auto; padding: 3px; border-radius: 50%; background: conic-gradient(var(--ink), var(--muted), var(--ink), var(--muted), var(--ink)); }
.ring.seen { background: var(--hairline); padding: 2px; }
.ring > .avatar { border: 2.5px solid var(--surface); }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 16px; }
.row.click { cursor: pointer; }
.row.click:hover { background: var(--surface2); }
.grow { flex: 1; min-width: 0; }
.name { font-weight: 600; }
.sub { color: var(--muted); font-size: 14px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section { color: var(--muted); font-size: 13px; font-weight: 600; padding: 18px 16px 6px; }
.capsule {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px;
  border-radius: 999px; background: var(--ink); color: var(--surface); font-weight: 600;
}
.capsule.light { background: var(--pressed); color: var(--ink); }
.capsule.small { height: 36px; padding: 0 16px; font-size: 15px; }
.capsule.block { width: 100%; }
.capsule:disabled { opacity: 0.5; }
.field {
  width: 100%; border: 0; outline: 0; background: var(--surface2); border-radius: 999px; padding: 13px 18px; font-size: 16px;
}
textarea.field { border-radius: 18px; resize: none; }
.search { margin: 0 16px 8px; display: flex; align-items: center; gap: 8px; background: var(--surface2); border-radius: 999px; padding: 0 14px; }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: none; padding: 11px 0; }
.empty { text-align: center; padding: 50px 30px; color: var(--muted); }
.empty h3 { color: var(--ink); margin: 0 0 6px; font-size: 19px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.chip svg { width: 16px; height: 16px; }
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); transform: translateX(-50%); z-index: 200;
  padding: 12px 20px; border-radius: 999px; font-size: 15px; max-width: calc(100% - 40px); text-align: center;
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop { from { transform: translate(-50%, 20px) scale(0.9); opacity: 0; } }

/* Sheets and alerts */
.overlay { position: fixed; inset: 0; z-index: 170; background: rgba(0, 0, 0, 0.32); display: flex; align-items: flex-end; justify-content: center; animation: fadein 0.2s; }
@keyframes fadein { from { opacity: 0; } }
.sheet {
  width: min(560px, 100%); max-height: 88vh; overflow: auto; margin: 8px; border-radius: 32px; background: var(--card);
  padding: 10px 0 18px; animation: up 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.sheet .handle { width: 38px; height: 5px; border-radius: 3px; background: var(--hairline); margin: 4px auto 8px; }
.sheet h2 { text-align: center; font-size: 17px; margin: 4px 16px 10px; }
@keyframes up { from { transform: translateY(60%); opacity: 0.4; } }
@media (min-width: 700px) { .overlay { align-items: center; } }
.alert { width: min(300px, 86vw); border-radius: 26px; background: var(--card); text-align: center; overflow: hidden; margin: auto; animation: pop2 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop2 { from { transform: scale(1.1); opacity: 0; } }
.alert .body { padding: 20px 18px 14px; }
.alert h3 { margin: 0 0 6px; font-size: 17px; }
.alert p { margin: 0; color: var(--muted); font-size: 14px; }
.alert input { margin-top: 12px; border-radius: 12px; }
.alert .actions { display: flex; border-top: 1px solid var(--hairline); }
.alert .actions button { flex: 1; padding: 13px; font-size: 17px; }
.alert .actions button + button { border-left: 1px solid var(--hairline); font-weight: 600; }
.alert .danger { color: var(--danger); }
.menu { position: fixed; z-index: 180; min-width: 200px; border-radius: 22px; padding: 6px; animation: pop2 0.2s; }
.menu button { display: block; width: 100%; text-align: left; padding: 11px 14px; border-radius: 14px; font-size: 16px; }
.menu button:hover { background: var(--pressed); }
.menu .danger { color: var(--danger); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .box { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
.auth .wordmark { font-size: 56px; text-align: center; margin-bottom: 4px; }
.auth p { margin: 0; text-align: center; color: var(--muted); }
.auth .link { text-align: center; color: var(--ink); font-weight: 600; padding: 8px; }
.error { color: var(--danger); text-align: center; font-size: 14px; min-height: 18px; }

/* ---------- Stories ---------- */
.tray { display: flex; gap: 12px; overflow-x: auto; padding: 4px 14px 14px; scrollbar-width: none; }
.tray::-webkit-scrollbar { display: none; }
.tray .item { width: 76px; flex: none; text-align: center; font-size: 12px; cursor: pointer; }
.tray .item .ellipsis { margin-top: 5px; }
.story-view { position: fixed; inset: 0; z-index: 150; background: #000; color: #fff; display: grid; place-items: center; }
.story-view .frame { position: relative; height: 100%; max-height: 100vh; aspect-ratio: 9 / 16; max-width: 100vw; background: #111; overflow: hidden; }
@media (min-width: 700px) { .story-view .frame { height: 94vh; border-radius: 22px; } }
.story-view img.pic { width: 100%; height: 100%; object-fit: cover; }
.story-view .bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; }
.story-view .bars span { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); overflow: hidden; }
.story-view .bars i { display: block; height: 100%; background: #fff; width: 0; }
.story-view .head { position: absolute; top: 22px; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; }
.story-view .shade { position: absolute; left: 0; right: 0; top: 0; height: 22%; background: linear-gradient(rgba(0,0,0,.55), transparent); pointer-events: none; }
.story-view .tapzone { position: absolute; top: 70px; bottom: 80px; width: 33%; }
.story-view .music { position: absolute; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 18px; color: var(--ink); max-width: 260px; transform: translate(-50%, -50%); }
.story-view .music img { width: 46px; height: 46px; border-radius: 10px; }
.story-view .reply { position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 14px); display: flex; gap: 8px; }
.story-view .reply input { flex: 1; border-radius: 999px; padding: 13px 18px; border: 0; outline: 0; color: var(--ink); }

/* ---------- Feed ---------- */
.post { margin-bottom: 18px; }
.post .media { width: 100%; background: var(--surface2); overflow: hidden; }
.post .media img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 700px) { .post .media { border-radius: 14px; } .post { padding: 0 8px; } }
.post .actions { display: flex; gap: 16px; padding: 10px 14px 4px; }
.post .actions svg { width: 26px; height: 26px; }
.post .actions .liked { color: var(--danger); }
.post .caption { padding: 2px 14px; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.grid .cell { aspect-ratio: 3 / 4; background: var(--surface2); position: relative; cursor: pointer; overflow: hidden; }
.grid .cell img { width: 100%; height: 100%; object-fit: cover; }
.grid .pin { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 999px; }

/* ---------- Profile ---------- */
.cover { width: 100%; aspect-ratio: 2.4; background: linear-gradient(var(--pressed), var(--surface2)); position: relative; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, var(--surface)); }
.profile-head { display: flex; align-items: flex-end; gap: 12px; padding: 0 16px; margin-top: -48px; position: relative; z-index: 1; }
.profile-head .stats { flex: 1; display: flex; justify-content: space-evenly; padding-bottom: 10px; }
.stat { text-align: center; cursor: pointer; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 13px; }
.bio { padding: 10px 18px 0; }
.buttons { display: flex; gap: 6px; padding: 14px 16px; }
.buttons .capsule { flex: 1; height: 40px; }
.highlights { display: flex; gap: 14px; overflow-x: auto; padding: 0 14px 12px; }
.highlights .h { width: 70px; flex: none; text-align: center; font-size: 12px; cursor: pointer; }
.highlights .h .c { width: 66px; height: 66px; border-radius: 50%; border: 1px solid var(--hairline); padding: 3px; }
.highlights .h .c img, .highlights .h .c div { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--pressed); }
.tabs { display: flex; border-bottom: 1px solid var(--hairline); }
.tabs button { flex: 1; height: 46px; display: grid; place-items: center; color: var(--muted); position: relative; }
.tabs button.on { color: var(--ink); }
.tabs button.on::after { content: ""; position: absolute; bottom: 0; width: 40%; height: 2px; border-radius: 2px; background: var(--ink); }
.tabs svg { width: 24px; height: 24px; }
.note-bubble {
  position: relative; display: inline-block; max-width: 110px; padding: 6px 10px; border-radius: 16px; background: var(--card);
  border: 0.5px solid var(--hairline); box-shadow: 0 3px 10px rgba(0,0,0,.1); font-size: 11px; line-height: 13px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.note-bubble.ph { color: var(--muted); }

/* ---------- Chats ---------- */
.quick { display: flex; gap: 8px; overflow-x: auto; padding: 6px 14px 10px; scrollbar-width: none; }
.quick .q { width: 80px; flex: none; text-align: center; font-size: 13px; cursor: pointer; }
.quick .q .nb { height: 46px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 4px; }
.conv .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); flex: none; }
.chat { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.chat .msgs { flex: 1; overflow-y: auto; padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 3px; }
.bubble-row { display: flex; }
.bubble-row.out { justify-content: flex-end; }
.bubble {
  max-width: min(76%, 480px); padding: 9px 14px; border-radius: 22px; background: var(--bubble-in); white-space: pre-wrap;
  word-break: break-word; position: relative; font-size: 16px; line-height: 1.35;
}
.out .bubble { background: var(--bubble-out); color: var(--on-out); }
.bubble.media { padding: 3px; background: none !important; }
.bubble.media img { max-width: 260px; max-height: 340px; border-radius: 19px; cursor: zoom-in; }
.bubble.sticker { background: none !important; font-size: 64px; line-height: 1; padding: 4px; text-align: center; color: var(--ink) !important; }
.bubble.sticker small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.bubble .react { position: absolute; bottom: -12px; right: 8px; background: var(--card); border-radius: 12px; font-size: 13px; padding: 1px 5px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.meta { font-size: 11px; color: var(--muted); margin: 2px 8px 6px; text-align: right; }
.day { text-align: center; font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(env(safe-area-inset-bottom) + 10px); }
.composer .box { flex: 1; display: flex; align-items: flex-end; gap: 4px; border-radius: 24px; padding: 4px 4px 4px 16px; min-height: 46px; }
.composer textarea { flex: 1; border: 0; outline: 0; background: none; resize: none; max-height: 140px; padding: 9px 0; font-size: 16px; line-height: 1.35; }
.composer .send { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--surface); display: grid; place-items: center; flex: none; margin: 1px; }
.composer .send svg, .composer .icon svg { width: 20px; height: 20px; }
.composer .icon { width: 38px; height: 38px; display: grid; place-items: center; flex: none; }
.stickers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 6px 16px; }
.stickers button { font-size: 44px; text-align: center; border-radius: 16px; padding: 6px 0; }
.stickers button:hover { background: var(--pressed); }
.stickers small { display: block; font-size: 11px; color: var(--muted); }
@media (min-width: 900px) {
  .two { display: flex; height: 100vh; }
  .two .list { width: 360px; flex: none; height: 100vh; margin: 0; max-width: none; border-right: 1px solid var(--hairline); overflow-y: auto; }
  .two .pane { height: 100vh; }
  .two .pane { flex: 1; min-width: 0; }
}

/* ---------- Groups ---------- */
.groups { display: flex; min-height: 100vh; }
.rail { width: 76px; flex: none; background: var(--bg); padding: calc(env(safe-area-inset-top) + 14px) 0 120px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rail.enter { animation: railin 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
@keyframes railin { from { transform: translateX(-100%); opacity: 0; } }
.rail .g { position: relative; width: 76px; display: grid; place-items: center; cursor: pointer; }
.rail .pill { position: absolute; left: 0; width: 4px; border-radius: 0 4px 4px 0; background: var(--ink); transition: height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.gicon { display: grid; place-items: center; background: var(--surface2); color: var(--ink); font-weight: 700; transition: border-radius 0.3s; flex: none; }
.gicon.sel { background: var(--ink); color: var(--surface); }
.panel { flex: 1; min-width: 0; padding-bottom: 120px; }
.channel { display: flex; align-items: center; gap: 8px; margin: 1px 8px; padding: 10px 10px; border-radius: 10px; color: var(--muted); cursor: pointer; font-weight: 500; }
.channel:hover { background: var(--surface2); }
.channel.unread { color: var(--ink); font-weight: 700; }
.channel svg { width: 20px; height: 20px; flex: none; }
.cat { display: flex; align-items: center; gap: 4px; padding: 16px 16px 2px 14px; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.cat svg { width: 12px; height: 12px; transition: transform 0.25s; transform: rotate(90deg); }
.cat.folded svg { transform: none; }
.intro { max-width: 520px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 50px) 24px 140px; text-align: center; }
.intro .big { width: 96px; height: 96px; border-radius: 32px; display: grid; place-items: center; margin: 0 auto 20px; }
.intro .big svg { width: 48px; height: 48px; }
.feature { display: flex; gap: 14px; align-items: center; text-align: left; padding: 14px; border-radius: 20px; margin: 10px 0; }
.feature .i { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--surface); display: grid; place-items: center; flex: none; }
.feature .i svg { width: 20px; height: 20px; }
.gmsg { display: flex; gap: 10px; padding: 1px 14px; }
.gmsg.first { padding-top: 10px; }
.gmsg .av { width: 40px; flex: none; }
.gmsg .who { font-weight: 700; font-size: 15px; }
.gmsg .when { color: var(--muted); font-size: 12px; margin-left: 6px; font-weight: 400; }
.gmsg .text { white-space: pre-wrap; word-break: break-word; }
.gmsg img.photo { max-width: 260px; max-height: 300px; border-radius: 14px; margin: 3px 0; }
.locked { color: var(--muted); font-style: italic; }

/* ---------- Page motion (like the phone app) ---------- */
.main.push { animation: pushin 0.38s cubic-bezier(0.2, 0.9, 0.3, 1); }
.main.pop { animation: popin 0.38s cubic-bezier(0.2, 0.9, 0.3, 1); }
.main.tab { animation: tabin 0.25s ease-out; }
@keyframes pushin { from { transform: translateX(40%); opacity: 0.4; } }
@keyframes popin { from { transform: translateX(-25%); opacity: 0.5; } }
@keyframes tabin { from { opacity: 0; transform: scale(0.985); } }
.main.swiping { transition: none; box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2); }
.main.settle { transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1); }
@media (prefers-reduced-motion: reduce) {
  .main.push, .main.pop, .main.tab, .rail.enter { animation: none; }
}

/* ---------- Story editor ---------- */
.story-view .frame.editor { touch-action: none; user-select: none; -webkit-user-select: none; }
.story-view .edit-pic { position: absolute; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.story-view .editor .head { top: calc(env(safe-area-inset-top) + 14px); }
.story-view .editor .foot {
  position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 16px);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.story-view .music.drag { cursor: grab; touch-action: none; }
.story-view .music.drag:active { cursor: grabbing; }

/* ---------- Music picker ---------- */
.songs { max-height: 46vh; overflow-y: auto; }
.song .art, .music-pick .art { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--surface2); display: grid; place-items: center; flex: none; }
.music-pick img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.song.on { background: var(--pressed); }
.picker-foot { display: grid; gap: 10px; padding: 12px 16px calc(env(safe-area-inset-bottom) + 14px); border-top: 0.5px solid var(--hairline); }
.music-pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; cursor: pointer; min-width: 0; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.eq i { width: 3px; background: currentColor; border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }

/* ---------- Post music: a line under the name, never on the photo ---------- */
.post .song-line { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); min-width: 0; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
.post .song-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post .song-line.on { color: var(--ink); }
