:root {
  color-scheme: light;
  --bg: #f7f7fb;
  --surface: #fff;
  --surface-soft: #f2f2f7;
  --line: #e8e8ef;
  --text: #22232f;
  --muted: #858694;
  --accent: #111;
  --accent-soft: #f3f3f3;
  --pink: #ff3040;
  --green: #238a72;
  --danger: #cf3f54;
  --shadow: 0 8px 28px #20203a0d;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #11111130;
  outline-offset: 2px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.brand-logo { width: 36px; height: 36px; display: block; flex: 0 0 auto; object-fit: contain; }
.brand-large { font-size: 30px; }
.brand-large .brand-logo { width: 42px; height: 42px; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 72px);
  background: radial-gradient(ellipse at 12% 90%, #ffe6ef 0, transparent 30%), radial-gradient(ellipse at 86% 7%, #e8e7ff 0, transparent 34%), #f8f8fc;
}
.auth-layout {
  width: min(1120px, 100%);
  min-height: min(700px, calc(100vh - 60px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  align-items: center;
  gap: clamp(32px, 7vw, 96px);
  direction: ltr;
}
.auth-story { min-width: 0; grid-column: 1; grid-row: 1; direction: rtl; }
.auth-topline { display: flex; align-items: center; justify-content: space-between; }
.auth-topline .brand { font-size: 24px; }
.language-control select, .settings-select {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
}
.auth-copy { max-width: 510px; margin: 56px 0 0; }
.eyebrow { margin: 0; color: var(--pink); font-size: 12px; font-weight: 800; letter-spacing: .3px; }
.auth-copy .eyebrow { margin-bottom: 12px; }
.auth-copy h1 { max-width: 470px; margin: 0; font-size: clamp(34px, 4vw, 52px); line-height: 1.35; letter-spacing: -.7px; }
.auth-copy > .muted { max-width: 420px; margin: 16px 0 0; font-size: 16px; line-height: 1.9; }
.social-preview { position: relative; height: 260px; margin-top: 20px; direction: ltr; }
.preview-orbit { position: absolute; top: 5px; left: 80px; width: 220px; height: 220px; border: 1px solid #e9def6; border-radius: 50%; }
.preview-photo { position: absolute; display: grid; place-items: center; overflow: hidden; border: 7px solid #fff; border-radius: 20px; box-shadow: var(--shadow); }
.preview-photo-one {
  top: 14px; left: 112px; width: 168px; height: 184px; transform: rotate(-7deg);
  background: radial-gradient(ellipse at 76% 34%, #fff8cc 0 7%, transparent 8%), linear-gradient(155deg, transparent 50%, #709b78 51% 65%, #54715c 66%), linear-gradient(180deg, #fac9bd, #f8dcb9 58%, #b8cdb5);
}
.preview-photo-one span { margin-top: 85px; margin-left: 84px; color: #fff7dc; font-size: 28px; }
.preview-photo-two {
  top: 56px; left: 252px; width: 128px; height: 145px; transform: rotate(8deg);
  background: radial-gradient(circle at 54% 46%, #fff7eb 0 12%, #f6a07a 13% 22%, transparent 23%), radial-gradient(circle at 54% 46%, #f5cfb6 0 35%, transparent 36%), linear-gradient(145deg, #d6c6fb, #ffc5d4);
}
.preview-photo-two span { align-self: end; margin-bottom: 6px; color: #fff; font-size: 22px; }
.preview-story { position: absolute; top: 188px; left: 80px; display: flex; gap: 7px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 40px; background: #fff; box-shadow: var(--shadow); }
.preview-story .story-ring { width: 35px; height: 35px; padding: 2px; }
.preview-story .story-ring > span { border-width: 1px; color: #fff; font-size: 12px; }
.preview-caption { position: absolute; top: 40px; left: 0; display: flex; align-items: center; gap: 9px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); color: #494a57; font-size: 13px; }
.preview-spark { color: var(--pink); }
.auth-card { grid-column: 2; grid-row: 1; width: 100%; padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 18px 55px #3a31500c; }
.auth-card-brand { margin-bottom: 24px; text-align: center; }
.auth-card-brand .brand { justify-content: center; }
.auth-card-brand .muted { margin: 10px 0 0; font-size: 13px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; margin-bottom: 22px; border-radius: 11px; background: var(--surface-soft); }
.tab { padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; }
.tab.active { color: var(--text); background: var(--surface); box-shadow: 0 1px 5px #24253212; }
label { display: block; color: #4a4b59; font-size: 13px; font-weight: 600; }
.auth-card form > label { margin: 13px 0; font-size: 12px; }
input, textarea { outline: none; border: 1px solid var(--line); border-radius: 10px; background: #fafafd; color: var(--text); transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #11111116; }
.auth-card input { display: block; width: 100%; margin-top: 7px; padding: 11px 12px; }
input::placeholder, textarea::placeholder { color: #a0a1ae; }
.button { border: 0; border-radius: 10px; padding: 10px 17px; font-weight: 700; transition: transform .18s, filter .18s; }
.button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.primary { color: #fff; background: #111; }
.secondary { border: 1px solid var(--line); background: var(--surface); color: #565766; }
.danger-button { color: #fff; background: var(--danger); }
.wide { width: 100%; min-height: 44px; margin-top: 7px; }
.form-error { min-height: 20px; color: var(--danger); font-size: 13px; }
.auth-footnote { margin: 19px 0 0 !important; color: #737582; font-size: 12px; text-align: center; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 68px; position: sticky; z-index: 20; top: 0;
  display: grid; grid-template-columns: minmax(180px, 240px) minmax(200px, 430px) minmax(140px, 200px) auto;
  align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 max(calc((100vw - 1250px)/2), 28px);
  border-bottom: 1px solid var(--line); background: var(--surface);
  backdrop-filter: blur(16px);
}
.topbar > .brand { grid-column: 1; grid-row: 1; }
.top-search { grid-column: 2; grid-row: 1; }
.top-user { grid-column: 3; grid-row: 1; }
.header-actions { grid-column: 4; grid-row: 1; display: flex; align-items: center; gap: 10px; }
.header-action { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text); }
.header-action svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.notification-button { color: var(--text); }
.notification-count { position: absolute; inset-block-start: 0; inset-inline-start: 0; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; border-radius: 20px; background: #e64968; color: #fff; font-size: 9px; font-weight: 800; }
.top-search { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--muted); }
.top-search:focus-within, .chat-search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #11111116; }
.top-search input { width: 100%; padding: 10px 0; border: 0; box-shadow: none; background: transparent; }
.top-search input:focus { border: 0; box-shadow: none; }
.top-user { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-size: 13px; font-weight: 700; }
.verified-badge { width: 15px; height: 15px; display: inline-grid; flex: 0 0 15px; place-items: center; color: #3897f0; vertical-align: -.12em; }
.verified-badge svg { width: 100%; height: 100%; display: block; }
.post-identity .verified-badge { margin-inline-start: 3px; }
.avatar { width: 39px; height: 39px; display: inline-grid; flex: 0 0 auto; place-items: center; overflow: hidden; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #aa6dff, #ed599f); font-weight: 800; box-shadow: 0 0 0 2px var(--surface); }
.avatar > img { width: 100%; height: 100%; min-width: 0; min-height: 0; display: block; border-radius: inherit; object-fit: cover; }
.layout { width: min(1250px, calc(100% - 48px)); display: grid; grid-template-columns: 210px minmax(0, 620px) 250px; gap: 38px; margin: 28px auto 80px; align-items: start; }
.sidebar { position: sticky; top: 98px; min-height: calc(100vh - 125px); display: flex; flex-direction: column; justify-content: space-between; }
.nav-list { display: grid; gap: 6px; }
.nav-item { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 13px; padding: 11px 14px; border: 0; border-radius: 11px; background: transparent; color: #666877; text-align: right; transition: background .2s, color .2s; }
.nav-item > span:first-child { width: 24px; height: 24px; display: inline-grid; flex: 0 0 24px; place-items: center; }
.nav-item > span + span { flex: 1; }
.nav-item:hover, .nav-item.active { color: #6548d1; background: var(--accent-soft); }
.nav-item svg, .mobile-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-note { display: grid; gap: 5px; padding: 15px; border: 1px solid #eee8ff; border-radius: 14px; background: linear-gradient(140deg, #f8f5ff, #fff5fa); font-size: 13px; }
.side-note span { color: var(--muted); font-size: 12px; }
.logout { margin-top: 12px; }
.content { min-width: 0; }
.page { animation: enter .25s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 19px; }
h1 { margin: 1px 0 0; font-size: 27px; letter-spacing: -.5px; }
.live-pill { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #e8e2ff; border-radius: 99px; background: #f6f3ff; color: var(--accent); font-size: 11px; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #8d6cf0; box-shadow: 0 0 8px #8d6cf088; }
.card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 2px 12px #29284706; }
.stories-panel { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.stories-heading { display: flex; align-items: baseline; gap: 9px; margin-bottom: 13px; color: #333441; font-size: 14px; }
.stories-list { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
.story-item { width: 66px; flex: 0 0 66px; display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: #555665; font-size: 11px; }
.story-item-name { width: 100%; display: flex; justify-content: center; align-items: center; gap: 3px; overflow: hidden; white-space: nowrap; }
.story-item-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-ring { width: 58px; height: 58px; padding: 3px; border-radius: 50%; background: linear-gradient(145deg, #ffbc65, #ee4b94, #885cff); }
.story-ring > span, .story-ring img, .story-ring video { width: 100%; height: 100%; border: 2px solid var(--surface); border-radius: inherit; background: var(--surface-soft); object-fit: cover; }
.story-ring > span { display: grid; place-items: center; font-size: 20px; font-weight: 800; }
.story-ring img, .story-ring video { display: block; }
.story-item .story-ring { position: relative; display: block; }
.story-ring > .story-video-mark { position: absolute; inset-block-end: 4px; inset-inline-end: 4px; width: 17px; height: 17px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #000a; color: #fff; font-size: 8px; line-height: 1; }
.story-avatar-ring { width: 43px; height: 43px; display: grid; flex: 0 0 43px; place-items: center; padding: 2px; border-radius: 50%; background: linear-gradient(145deg, #ffbc65, #ee4b94, #885cff); }
.story-avatar-ring .avatar { width: 100%; height: 100%; border: 2px solid var(--surface); box-shadow: none; }
.story-add .story-ring { background: #eae8f5; }
.story-add .story-ring > span { color: var(--accent); }
.story-add-ring { position: relative; }
.story-add-ring .story-owner-avatar { border-color: var(--surface); background: var(--accent-soft); color: var(--accent); font-size: 19px; }
.story-add-ring b { position: absolute; inset-inline-end: -2px; inset-block-end: -1px; width: 21px; height: 21px; display: grid; place-items: center; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; line-height: 1; }
.composer { margin: 17px 0; padding: 16px; }
.composer-head { display: flex; align-items: center; gap: 10px; }
.composer-head div { display: grid; gap: 3px; font-size: 13px; }
.composer-head small, .post-identity small { color: var(--muted); font-size: 11px; }
.composer textarea { width: 100%; min-height: 75px; resize: vertical; margin: 14px 0 10px; padding: 12px; }
.media-picker { position: relative; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 13px; background: var(--surface-soft); color: var(--text); cursor: pointer; transition: border-color .18s, background .18s; }
.media-picker:hover { border-color: var(--accent); background: var(--surface); }
.media-picker:focus-within { outline: 3px solid #11111130; outline-offset: 2px; }
.media-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; clip: rect(0, 0, 0, 0); }
.media-picker-icon { width: 42px; height: 42px; display: grid; flex: 0 0 42px; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 21px; }
.media-picker-copy { min-width: 0; display: grid; flex: 1; gap: 4px; }
.media-picker-copy strong { font-size: 13px; }
.media-picker-copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.media-picker-cta { flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 11px; font-weight: 700; }
.media-error { margin: 9px 0 0; color: var(--danger); font-size: 12px; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; }
.media-limit { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.composer-buttons { display: flex; flex: 0 0 auto; gap: 8px; }
.composer-buttons .button { min-height: 40px; padding-inline: 14px; }
.create-cancel { margin-top: 0; }
.feed-list { display: grid; gap: 17px; }
.post-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 3px 14px #15141f0a; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.post-identity { min-width: 0; display: grid; flex: 1; gap: 2px; font-size: 13px; }
.text-button { padding: 5px; border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 700; }
.post-menu-trigger { width: 40px; height: 40px; display: grid; flex: 0 0 40px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.post-menu-trigger:hover { background: var(--surface-soft); color: var(--text); }
.post-menu-trigger svg { width: 22px; height: 22px; }
.post-media { position: relative; }
.post-image { width: 100%; max-height: 600px; display: block; background: #f3f3f6; object-fit: contain; }
.reel-badge { position: absolute; z-index: 1; inset-block-start: 12px; inset-inline-end: 12px; padding: 5px 9px; border-radius: 999px; background: #08090ac9; color: #fff; font-size: 11px; font-weight: 700; }
.post-actions { display: flex; align-items: center; gap: 5px; direction: ltr; padding: 8px 12px 2px; }
.post-action-group { display: flex; align-items: center; gap: 4px; }
.post-action-count { min-width: 1ch; color: var(--text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.like-button { display: inline-flex; align-items: center; gap: 7px; padding: 2px 3px; border: 0; background: transparent; color: var(--text); }
.post-action-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.post-action[data-comments-post] .post-action-icon { transform: scale(1.1, 1.03); }
.post-action[data-share-post] .post-action-icon { transform: scale(.98, .88); }
.post-action.save-button .post-action-icon { transform: scale(1.17, 1); }
.like-icon { color: var(--text); }
.like-button.liked .like-icon { fill: var(--pink); stroke: var(--pink); }
.save-button.saved .post-action-icon { fill: currentColor; }
.post-caption { padding: 12px 15px 16px; color: #393a47; font-size: 13px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-feed, .empty-state { display: grid; justify-items: center; gap: 8px; padding: 42px 15px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); text-align: center; }
.empty-feed strong, .empty-state strong { color: var(--text); }
.empty-feed p, .empty-state p { margin: 0; font-size: 12px; }
.empty-icon { color: var(--accent); font-size: 30px; }
.rightbar { position: sticky; top: 100px; }
.side-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; color: #444552; font-size: 13px; }
.suggestion { display: flex; align-items: center; gap: 8px; padding: 9px 0; }
.suggestion-info { min-width: 0; display: grid; flex: 1; gap: 2px; font-size: 12px; }
.suggestion-info small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.suggestion .button { padding: 7px 10px; font-size: 11px; }
.safety-note { display: flex; gap: 9px; margin-top: 27px; padding: 13px; border: 1px solid #e4eee8; border-radius: 13px; background: #f2f8f4; font-size: 18px; }
.safety-note p { margin: 0; color: #66786f; font-size: 11px; line-height: 1.7; }
.footer-note { margin-top: 18px; }

.search-card { padding: 16px; }
.search-card label { margin-bottom: 8px; }
.search-card input, .chat-search-field input { width: 100%; padding: 11px; }
.search-card input { min-height: 42px; border-radius: 999px; background: var(--surface-soft); }
.people-list { display: grid; gap: 8px; margin-top: 15px; }
.person-row { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 2px 10px #29284705; }
.person-info { display: grid; flex: 1; gap: 3px; font-size: 13px; }
.person-info small { color: var(--muted); }
.subheading { margin: 26px 0 12px; color: #373845; font-size: 17px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.grid-image { position: relative; aspect-ratio: 1; overflow: hidden; padding: 0; border: 0; border-radius: 6px; background: var(--surface-soft); }
.grid-image img, .grid-image video { width: 100%; height: 100%; object-fit: cover; }
.grid-image video { pointer-events: none; }
.grid-video-icon { position: absolute; inset-block-start: 7px; inset-inline-end: 7px; color: #fff; font-size: 16px; line-height: 1; text-shadow: 0 1px 5px #000; pointer-events: none; }
.grid-like-count { position: absolute; inset-inline: 0; inset-block-end: 0; display: flex; justify-content: center; gap: 5px; padding: 14px 5px 7px; background: linear-gradient(transparent, #111b); color: #fff; font-size: 12px; font-weight: 700; opacity: 0; transition: opacity .16s; pointer-events: none; }
.grid-image:hover .grid-like-count, .grid-image:focus-visible .grid-like-count { opacity: 1; }
.search-empty { padding: 15px; color: var(--muted); font-size: 13px; }

.chat-layout { min-height: 510px; display: grid; grid-template-columns: 230px minmax(0, 1fr); overflow: hidden; }
.chat-list-panel { min-width: 0; border-inline-end: 1px solid var(--line); }
.chat-search { padding: 12px; }
.chat-search-field { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); }
.chat-search-field svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-search-field input { min-width: 0; flex: 1; border: 0; background: transparent; box-shadow: none; font-size: 12px; }
.chat-search-field input:focus { border: 0; box-shadow: none; }
.chat-list, .chat-search-results { max-height: 390px; overflow-y: auto; }
.chat-list.is-empty { height: 390px; display: grid; }
.chat-list.is-searching { display: none; }
.chat-empty-state { min-height: 390px; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 24px 20px; text-align: center; }
.chat-empty-art { position: relative; width: 96px; height: 96px; display: grid; place-items: center; margin-bottom: 3px; }
.chat-empty-halo { position: absolute; inset: 5px; border-radius: 32px; background: linear-gradient(135deg, #7858e827, #df4f9a27); transform: rotate(45deg); }
.chat-empty-bubble { position: relative; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 22px 22px 22px 8px; background: linear-gradient(145deg, #7858e8, #df4f9a); color: #fff; box-shadow: 0 12px 24px #a348d833; transform: rotate(-4deg); }
.chat-empty-bubble svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chat-empty-spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #e85a9e; box-shadow: 0 0 0 4px #e85a9e18; }
.chat-empty-spark-one { inset-block-start: 14px; inset-inline-end: 8px; }
.chat-empty-spark-two { width: 5px; height: 5px; inset-block-end: 13px; inset-inline-start: 10px; background: #8a6ce7; box-shadow: 0 0 0 4px #8a6ce718; }
.chat-empty-kicker { color: #7858d2; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
.chat-empty-state strong, .chat-window-empty strong { color: var(--text); font-size: 17px; font-weight: 800; }
.chat-empty-state p, .chat-window-empty p { max-width: 260px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.chat-empty-state .button { min-height: 42px; margin-top: 4px; padding-inline: 18px; border-radius: 12px; background: linear-gradient(135deg, #7858e8, #df4f9a); }
.chat-row { width: 100%; display: flex; align-items: center; gap: 9px; padding: 12px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: right; }
.chat-row:hover, .chat-row.selected { background: var(--accent-soft); }
.chat-row > span:last-child { display: grid; gap: 3px; font-size: 12px; }
.chat-row small, .chat-title-info small { color: var(--muted); }
.chat-window { min-width: 0; display: flex; flex-direction: column; }
.chat-window-empty { flex: 1; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.chat-window-empty .chat-empty-art { margin-bottom: 5px; }
.chat-title { display: flex; align-items: center; gap: 9px; padding: 12px; border-bottom: 1px solid var(--line); }
.chat-title-info { min-width: 0; display: grid; flex: 1; gap: 2px; font-size: 12px; }
.call-button { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text); }
.call-button:hover { background: var(--surface-soft); }
.call-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.video-call-button { color: var(--text); }
.messages-list { min-height: 300px; max-height: 390px; display: flex; flex: 1; flex-direction: column; gap: 7px; overflow-y: auto; padding: 13px; background: var(--bg); }
.message-bubble { width: fit-content; max-width: 78%; align-self: flex-start; padding: 8px 11px; border: 0; border-radius: 18px 18px 18px 5px; background: var(--surface-soft); color: var(--text); font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-bubble.mine { align-self: flex-end; border-radius: 18px 18px 5px 18px; background: #3797f0; color: #fff; }
.message-bubble.has-audio { display: grid; gap: 5px; padding: 8px 10px; }
.voice-player { width: 190px; max-width: 100%; display: flex; align-items: center; gap: 7px; color: var(--text); }
.voice-audio { display: none; }
.voice-play { width: 30px; height: 30px; display: grid; flex: 0 0 30px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--text); color: var(--surface); }
.voice-play svg { width: 14px; height: 14px; fill: currentColor; }
.message-bubble.mine .voice-play { background: #fff; color: #2788dc; }
.voice-wave { min-width: 0; display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 2px; height: 24px; }
.voice-wave i { width: 2px; height: var(--bar-height); max-height: 21px; border-radius: 2px; background: currentColor; opacity: .35; }
.voice-wave i.played { opacity: 1; }
.voice-duration { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.message-bubble.mine .voice-duration { color: #ffffffc7; }
.message-bubble.mine .voice-wave i { opacity: .55; }
.message-bubble.mine .voice-wave i.played { opacity: 1; }
.message-bubble time { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.message-bubble.mine time { color: #ffffffc7; }
.message-compose { display: flex; align-items: center; gap: 5px; padding: 8px 10px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.message-compose input[type=text] { min-width: 0; min-height: 40px; flex: 1; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); font-size: 13px; }
.icon-button { min-width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.record-button { width: 36px; min-width: 36px; height: 36px; display: grid; flex: 0 0 36px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text); }
.record-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.record-button:hover { background: var(--surface-soft); }
.record-button.recording { color: #fff; background: #d94359; animation: pulse 1s infinite alternate; }
.message-send { width: 36px; min-width: 36px; height: 36px; display: grid; flex: 0 0 36px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #3797f0; color: #fff; }
.message-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.message-send:hover { filter: brightness(1.05); }
@keyframes pulse { to { box-shadow: 0 0 0 4px #ff5b6b32; } }

.profile-card { display: grid; gap: 0; padding: 16px 4px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.profile-main { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 18px; }
.profile-summary { min-width: 0; display: grid; gap: 9px; }
.profile-avatar { width: 104px; height: 104px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); font-size: 38px; }
.profile-photo-frame { width: 104px; height: 104px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); place-items: center; border-radius: 50%; }
.profile-photo-frame.has-story { padding: 3px; background: linear-gradient(145deg, #ffbc65, #ee4b94, #885cff); }
.profile-photo-frame.has-story .profile-photo-trigger { border: 3px solid var(--surface); }
.profile-photo-trigger { width: 100%; height: 100%; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: zoom-in; }
.profile-photo-trigger .profile-avatar { width: 100%; height: 100%; min-width: 0; min-height: 0; transition: transform .16s; }
.profile-photo-trigger:hover .profile-avatar { transform: scale(1.03); }
.profile-info { min-width: 0; display: grid; gap: 7px; margin-top: 12px; }
.profile-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-identity h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; font-size: 19px; }
.profile-identity p { margin: 0; color: var(--muted); font-size: 13px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-actions { margin-top: 4px; }
.profile-actions .button { min-height: 35px; flex: 1; padding: 7px 12px; border-radius: 8px; font-size: 12px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; }
.profile-stats > * { min-width: 0; display: grid; justify-items: center; align-content: center; gap: 3px; padding: 4px 1px; color: var(--muted); font-size: 11px; text-align: center; }
.profile-stats button { border: 0; border-radius: 9px; background: transparent; }
.profile-stats button:hover { background: var(--surface-soft); }
.profile-stats button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.profile-stats b { color: var(--text); font-size: 17px; }
.profile-bio { margin: 0; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-connections-back { margin: 0 0 10px; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 700; }
.connections-header { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.connections-header h1 { margin: 0; font-size: 20px; }
.connections-list { display: grid; gap: 4px; }
.connection-row { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 4px; }
.connection-profile { min-width: 0; display: flex; flex: 1; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; text-align: start; }
.connection-profile .avatar { width: 46px; height: 46px; }
.connection-info { min-width: 0; display: grid; gap: 3px; }
.connection-info strong, .connection-info small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-info strong { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.connection-info small { color: var(--muted); font-size: 10px; }
.connection-row > .button { min-width: 88px; padding: 8px 10px; font-size: 11px; }
.connections-empty { padding: 26px 10px; color: var(--muted); font-size: 13px; text-align: center; }
.edit-profile-header { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.edit-profile-header .eyebrow { margin-bottom: 2px; }
.edit-profile-header h1 { margin: 0; font-size: 22px; }
.edit-profile-back { width: 38px; height: 38px; display: grid; flex: 0 0 38px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); }
.edit-profile-back svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.edit-profile-form { display: grid; gap: 11px; padding: 18px; }
.edit-profile-photo { display: flex; align-items: center; gap: 14px; margin-bottom: 5px; }
.edit-profile-photo .profile-avatar { width: 76px; height: 76px; font-size: 26px; }
.edit-profile-photo-copy { min-width: 0; display: grid; justify-items: start; gap: 4px; }
.edit-profile-photo-copy small { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-profile-form input:not([type="file"]) { width: 100%; min-height: 42px; padding: 10px 12px; }
.edit-profile-form textarea { width: 100%; min-height: 100px; resize: vertical; padding: 11px 12px; line-height: 1.6; }
.edit-profile-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.edit-profile-actions { display: flex; gap: 8px; }
.edit-profile-actions .button { min-width: 82px; }
.profile-gallery-heading { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; padding: 12px; border-top: 1px solid var(--line); color: var(--accent); font-size: 12px; }
.profile-gallery-heading span { font-size: 18px; }
.profile-grid { margin: 0 -12px; gap: 2px; }
.profile-grid .grid-image { border-radius: 0; }
.profile-photo-dialog { position: fixed; width: min(82vw, 400px, calc(100dvh - 80px)); height: min(82vw, 400px, calc(100dvh - 80px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 40px); margin: auto; padding: 0; overflow: visible; border: 0; background: transparent; color: #fff; }
.profile-photo-dialog::backdrop { background: #08090fda; backdrop-filter: blur(5px); }
.profile-photo-dialog > .dialog-close { position: fixed; inset: 16px 16px auto auto; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #fff; background: #fff; color: #252630; box-shadow: 0 4px 16px #0005; font-size: 0; line-height: 1; transition: transform .16s, background .16s; }
.profile-photo-dialog > .dialog-close::before, .profile-photo-dialog > .dialog-close::after { position: absolute; inset: 0; width: 17px; height: 2px; margin: auto; border-radius: 2px; background: currentColor; content: ""; }
.profile-photo-dialog > .dialog-close::before { transform: rotate(45deg); }
.profile-photo-dialog > .dialog-close::after { transform: rotate(-45deg); }
.profile-photo-dialog > .dialog-close:hover { transform: scale(1.05); background: #f1f2f6; }
.profile-photo-dialog > .dialog-close:focus-visible { outline: 3px solid #3897f0; outline-offset: 3px; }
.profile-photo-preview { width: 100%; height: 100%; border: 3px solid #fff; box-shadow: 0 20px 70px #0008; font-size: 120px; }
.post-dialog { position: fixed; width: min(100vw, 480px); max-width: 100vw; max-height: min(92dvh, 850px); margin: auto; padding: 0; overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px #08080d55; }
.post-dialog::backdrop { background: #101018b8; backdrop-filter: blur(4px); }
.post-dialog > .dialog-close { position: absolute; z-index: 3; inset-block-start: 9px; inset-inline-end: 9px; display: grid; place-items: center; background: #0008; }
.post-dialog .post-card { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.post-dialog .post-image { max-height: min(70dvh, 650px); }
.settings-list { display: grid; gap: 13px; }
.settings-heading { align-items: center; margin-bottom: 22px; }
.settings-heading-icon { width: 44px; height: 44px; display: grid; flex: 0 0 44px; place-items: center; border-radius: 15px; background: linear-gradient(135deg, #7858e8, #df4f9a); color: #fff; box-shadow: 0 7px 18px #9865dc38; }
.settings-heading-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.settings-card { min-height: 96px; display: flex; align-items: center; gap: 15px; padding: 18px; transition: border-color .18s, box-shadow .18s; }
.settings-icon { width: 42px; height: 42px; display: grid; flex: 0 0 42px; place-items: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent); font-size: 18px; font-weight: 700; }
.settings-icon-language { background: #f0edff; color: #6851c8; }
.settings-icon-appearance { background: #fff4df; color: #d58a16; }
.settings-icon-privacy { background: #e9f7f2; color: #238a72; }
.settings-icon-requests { background: #fff0f6; color: #c6407c; }
.settings-icon-saved { background: #edf4ff; color: #397cc6; }
.settings-copy { flex: 1; }
.settings-copy h2 { margin: 0; color: var(--text); font-size: 15px; }
.settings-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.settings-select { min-width: 116px; }
.settings-theme-card { flex-wrap: wrap; }
.theme-options { display: flex; gap: 7px; }
.theme-option { min-width: 80px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: #686a78; font-size: 12px; transition: border-color .18s, background .18s, color .18s, transform .18s; }
.theme-option:hover { border-color: #cfc5f4; transform: translateY(-1px); }
.theme-option.active { border-color: #d7cdf8; background: #f7f4ff; color: #694bd6; font-weight: 700; box-shadow: 0 2px 6px #6149c411; }
.theme-option > span:first-child { display: grid; place-items: center; }
.theme-option svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.settings-info { display: flex; align-items: center; gap: 10px; padding: 8px 3px; color: var(--muted); font-size: 12px; }
.settings-info p { margin: 0; }
.settings-info-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #edf7f1; color: var(--green); }

.story-dialog { position: fixed; width: min(100vw, 480px); max-width: 100vw; height: min(100dvh, 850px); max-height: 100dvh; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 18px; background: #09090b; color: #fff; box-shadow: 0 24px 80px #08080d55; }
.call-dialog { width: min(92vw, 430px); max-height: 90vh; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px #08080d33; }
.story-dialog::backdrop, .call-dialog::backdrop { background: #101018d9; backdrop-filter: blur(5px); }
.story-dialog > img, .story-dialog > video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #09090b; object-fit: contain; }
.dialog-close { position: absolute; z-index: 1; inset-block-start: 9px; inset-inline-end: 9px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #0008; color: #fff; font-size: 25px; }
.story-progress { position: absolute; z-index: 4; inset: 10px 12px auto; height: 3px; overflow: hidden; border-radius: 5px; background: #ffffff55; }
.story-progress span { width: 100%; height: 100%; display: block; background: #fff; transform-origin: left center; }
@keyframes story-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.story-viewer-head { position: absolute; z-index: 4; inset: 22px 14px auto; display: flex; align-items: center; gap: 9px; min-height: 42px; }
.story-viewer-head .avatar { width: 35px; height: 35px; border: 2px solid #fff; font-size: 13px; }
.story-owner-info { min-width: 0; display: grid; flex: 1; gap: 2px; text-shadow: 0 1px 5px #000; }
.story-owner-info strong { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.story-owner-info small { color: #ffffffb8; font-size: 10px; }
.story-viewer-head .dialog-close { position: static; flex: 0 0 36px; background: #0006; }
.story-nav { position: absolute; z-index: 2; top: 72px; bottom: 145px; width: 36%; border: 0; background: transparent; }
.story-nav-prev { left: 0; }
.story-nav-next { right: 0; }
.story-caption { position: absolute; z-index: 4; inset-inline: 18px; bottom: 62px; color: #fff; font-size: 14px; line-height: 1.6; text-shadow: 0 1px 6px #000; }
.story-meta { position: absolute; z-index: 4; inset-inline: 12px; bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #fff; font-size: 12px; text-shadow: 0 1px 5px #000; }
.story-meta strong { color: #fff; }
.story-meta button { border: 0; background: transparent; color: #fff; font-size: 12px; }
.story-viewers-list { position: absolute; z-index: 5; inset-inline: 0; bottom: 0; max-height: 44%; overflow-y: auto; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: #111e; backdrop-filter: blur(16px); }
.story-viewers-sheet-head { position: sticky; top: -10px; display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 7px 0 12px; background: #111e; color: #fff; font-size: 13px; }
.story-viewers-handle { position: absolute; top: 2px; left: 50%; width: 38px; height: 4px; transform: translateX(-50%); border-radius: 4px; background: #ffffff88; }
.story-viewers-close { position: absolute; inset-inline-end: 0; top: 0; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #ffffff20; color: #fff; font-size: 21px; line-height: 1; }
.story-viewer-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-top: 1px solid var(--line); }
.story-viewer-row .avatar { width: 33px; height: 33px; font-size: 12px; }
.story-viewer-info { min-width: 0; display: grid; flex: 1; gap: 2px; font-size: 12px; }
.story-viewer-info small, .story-viewer-row time { color: #ffffffa6; font-size: 10px; }
.story-viewers-empty { margin: 0; padding: 12px 0; color: #ffffffa6; font-size: 12px; text-align: center; }
.story-viewers-list .story-viewer-row { border-color: #ffffff24; }
.notifications-page-list { display: grid; gap: 2px; }
.notifications-page-list .notification-row { align-items: center; padding: 13px 12px; border-bottom: 1px solid var(--line); border-radius: 10px; }
.notification-row.unread { background: var(--accent-soft); }
.empty-modal-message { padding: 25px 12px; color: var(--muted); font-size: 13px; text-align: center; }
.call-dialog { width: min(92vw, 590px); padding: 22px; }
.call-dialog-header { position: relative; display: flex; min-height: 42px; align-items: center; justify-content: center; text-align: center; }
.call-status { margin: 0; font-size: 18px; font-weight: 750; }
.call-contact { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.call-dialog .dialog-close { inset-block-start: -8px; inset-inline-end: -8px; background: var(--surface-soft); color: var(--text); }
.call-media { position: relative; min-height: 260px; display: grid; place-items: center; overflow: hidden; margin-top: 18px; border-radius: 14px; background: #171721; }
.call-media video { width: 100%; height: 330px; object-fit: cover; }
.audio-call-placeholder { display: grid; width: 84px; height: 84px; place-items: center; border: 1px solid #ffffff24; border-radius: 50%; background: linear-gradient(145deg, #7658e8, #e653a0); color: #fff; font-size: 34px; }
#local-video:not(.hidden) { position: absolute; inset-block-end: 12px; inset-inline-end: 12px; width: 25%; height: 100px; border: 2px solid #fff; border-radius: 10px; background: #272733; }
#remote-video.hidden { display: none; }
#local-video.hidden { display: none; }
#remote-audio { position: absolute; width: 1px; height: 1px; opacity: 0; }
.call-subtitle { margin: 12px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.call-actions { display: flex; justify-content: center; gap: 9px; margin-top: 17px; }
.toast { position: fixed; z-index: 50; inset-inline-start: 50%; bottom: 25px; max-width: calc(100vw - 30px); padding: 11px 16px; border: 1px solid #e6e2f2; border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: all .2s; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-nav { display: none; }

.theme-dark {
  color-scheme: dark;
  --bg: #11131a;
  --surface: #191c25;
  --surface-soft: #20232e;
  --line: #2b2f3b;
  --text: #f3f4f8;
  --muted: #a0a5b2;
  --accent: #f3f3f3;
  --accent-soft: #292b31;
  --pink: #ff5268;
  --green: #65dec5;
  --danger: #e95d70;
  --shadow: 0 8px 28px #0003;
  background: var(--bg);
  color: var(--text);
}
.theme-dark body { background: var(--bg); color: var(--text); }
.theme-dark .primary { background: #f3f3f3; color: #111; }
.theme-dark .auth-screen { background: radial-gradient(ellipse at 15% 86%, #382333 0, transparent 33%), radial-gradient(ellipse at 84% 10%, #28233c 0, transparent 35%), #11131a; }
.theme-dark .auth-card { border-color: var(--line); background: var(--surface); }
.theme-dark .auth-copy h1, .theme-dark label, .theme-dark .nav-item { color: var(--text); }
.theme-dark .auth-card input, .theme-dark input, .theme-dark textarea { border-color: #343744; background: #12141b; color: var(--text); }
.theme-dark .search-card input, .theme-dark #share-search { background: var(--surface-soft); }
.theme-dark .top-search input, .theme-dark .chat-search-field input { border-color: transparent; background: transparent; }
.theme-dark .auth-tabs { background: #11131a; }
.theme-dark .tab.active { color: var(--text); background: #2a2d38; }
.theme-dark .auth-footnote, .theme-dark .auth-copy > .muted, .theme-dark .auth-card-brand .muted { color: var(--muted); }
.theme-dark .language-control select, .theme-dark .settings-select, .theme-dark .theme-option { border-color: #343744; background: var(--surface-soft); color: var(--text); }
.theme-dark .preview-photo, .theme-dark .preview-story, .theme-dark .preview-caption { border-color: #343744; background-color: var(--surface-soft); color: var(--text); }
.theme-dark .preview-orbit { border-color: #343744; }
.theme-dark .topbar { background: #11131af2; }
.theme-dark .top-search, .theme-dark .chat-search-field { border-color: var(--line); background: var(--surface-soft); }
.theme-dark .card, .theme-dark .stories-panel, .theme-dark .person-row, .theme-dark .chat-layout, .theme-dark .profile-card { border-color: var(--line); background: var(--surface); }
.theme-dark .nav-item:hover, .theme-dark .nav-item.active { color: #fff; background: #272432; }
.theme-dark .side-note { border-color: #47334f; background: linear-gradient(140deg, #352544, #1d2029); }
.theme-dark .stories-heading, .theme-dark .story-item, .theme-dark .post-caption, .theme-dark .side-heading { color: #daddE5; }
.theme-dark .story-ring > span, .theme-dark .story-ring img, .theme-dark .story-ring video { border-color: var(--surface); background: var(--surface-soft); }
.theme-dark .story-add .story-ring { background: #393c48; }
.theme-dark .post-image { background: #101117; }
.theme-dark .like-icon { color: #c4c6ce; }
.theme-dark .like-button.liked .like-icon { fill: var(--pink); stroke: var(--pink); }
.theme-dark .empty-feed, .theme-dark .empty-state { border-color: #353846; }
.theme-dark .chat-row { border-color: #252833; }
.theme-dark .chat-empty-kicker { color: #c1a8ff; }
.theme-dark .chat-row:hover, .theme-dark .chat-row.selected { background: #252432; }
.theme-dark .messages-list { background: var(--bg); }
.theme-dark .message-bubble { background: var(--surface-soft); color: var(--text); }
.theme-dark .message-bubble.mine { background: #3797f0; color: #fff; }
.theme-dark .message-compose { border-color: var(--line); background: var(--surface); }
.theme-dark .call-button, .theme-dark .video-call-button { border-color: transparent; background: transparent; color: var(--text); }
.theme-dark .profile-card { border-color: transparent; background: transparent; }
.theme-dark .safety-note { border-color: #2d4946; background: #182622; }
.theme-dark .safety-note p { color: #b9c9c5; }
.theme-dark .settings-icon { background: #302748; color: #c1a8ff; }
.theme-dark .theme-option.active { border-color: #534778; background: #302748; color: #d3c8ff; }
.theme-dark .settings-info { color: var(--muted); }
.theme-dark .settings-info-icon { background: #1b322e; }
.theme-dark .mobile-nav { border-color: var(--line); background: #151720f5; }
.theme-dark .mobile-nav button { color: var(--muted); }
.theme-dark .mobile-nav button.active { color: var(--pink); }
.theme-dark .call-dialog { border-color: var(--line); background: var(--surface); color: var(--text); }
.theme-dark .call-dialog .dialog-close { background: #343744; color: var(--text); }

@media (max-width: 1120px) {
  .layout { grid-template-columns: 190px minmax(0, 640px); justify-content: center; gap: 28px; }
  .rightbar { display: none; }
  .topbar { grid-template-columns: minmax(100px, 160px) minmax(70px, 1fr) minmax(90px, 130px) auto; gap: 12px; padding-inline: 12px; }
}
@media (max-width: 820px) {
  .auth-screen { padding: 24px; }
  .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(310px, 390px); gap: 28px; }
  .auth-copy { margin-top: 38px; }
  .preview-photo-one { left: 70px; }
  .preview-photo-two { left: 205px; }
  .layout { width: min(700px, calc(100% - 28px)); display: block; margin: 18px auto 78px; }
  .sidebar { display: none; }
  .content { width: 100%; margin: auto; }
  .mobile-nav { position: fixed; z-index: 30; inset-inline: 0; bottom: 0; height: 62px; display: flex; justify-content: space-around; border-top: 1px solid var(--line); background: #ffffffef; backdrop-filter: blur(15px); }
  .mobile-nav button { width: 20%; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); }
  .mobile-nav button.active { color: var(--accent); }
  .grid-like-count { opacity: 1; }
}
@media (max-width: 640px) {
  .auth-screen { padding: 16px; }
  .auth-layout { min-height: auto; display: block; }
  .auth-story { display: none; }
  .auth-card { max-width: 430px; margin: 0 auto; padding: 27px 22px; }
  .topbar { height: 60px; grid-template-columns: 1fr auto; gap: 10px; padding: 0 15px; }
  .topbar > .brand { font-size: 20px; }
  .brand-logo { width: 33px; height: 33px; }
  .top-search { display: none; }
  .top-user { font-size: 11px; }
  .top-user .avatar { width: 33px; height: 33px; }
  .layout { width: 100%; margin-top: 14px; }
  .content { padding: 0 12px; }
  h1 { font-size: 23px; }
  .stories-panel, .composer, .post-card { border-radius: 13px; }
  .chat-layout { min-height: calc(100dvh - 155px); display: block; border-radius: 13px; }
  .chat-list-panel { width: 100%; border: 0; }
  .chat-list, .chat-search-results { max-height: calc(100dvh - 250px); overflow-y: auto; }
  .chat-list.is-empty { height: auto; min-height: max(360px, calc(100dvh - 220px)); max-height: none; overflow: visible; }
  .chat-list.is-empty .chat-empty-state { min-height: max(360px, calc(100dvh - 220px)); }
  .chat-empty-state { padding: 30px 22px; }
  .chat-row { flex-direction: row; gap: 12px; padding: 12px; text-align: start; }
  .chat-row .avatar { width: 46px; height: 46px; }
  .chat-row > span:last-child { min-width: 0; max-width: none; flex: 1; }
  .chat-row strong, .chat-row small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-search { padding: 10px 12px; }
  .chat-search-field { min-height: 42px; padding: 0 12px; border-radius: 22px; }
  .chat-search-field input { min-height: 40px; padding: 10px 0; border-radius: 0; font-size: 13px; }
  .chat-window { display: none; min-height: calc(100dvh - 155px); }
  .chat-layout.has-chat .chat-list-panel { display: none; }
  .chat-layout.has-chat .chat-window { display: flex; }
  .chat-back-button { width: 34px; height: 34px; display: grid; flex: 0 0 34px; place-items: center; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--text); }
  .chat-back-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .chat-title { gap: 6px; padding: 9px 7px; }
  .chat-title .avatar { width: 31px; height: 31px; }
  .chat-title-info { font-size: 10px; }
  .call-button { width: 32px; height: 32px; }
  .messages-list { min-height: 0; max-height: none; height: calc(100dvh - 260px); padding: 10px 7px; }
  .message-compose { gap: 4px; padding: 7px; }
  .message-compose input[type=text] { padding: 9px 6px; font-size: 11px; }
  .voice-player { width: 165px; gap: 6px; }
  .voice-play { width: 28px; height: 28px; flex-basis: 28px; }
  .voice-wave { gap: 1px; }
  .icon-button { min-width: 31px; height: 33px; }
  .profile-card { gap: 0; padding: 14px 4px; }
  .profile-main { grid-template-columns: 102px minmax(0, 1fr); gap: 13px; }
  .profile-summary { gap: 8px; }
  .profile-avatar { width: 96px; height: 96px; font-size: 35px; }
  .profile-photo-frame { width: 96px; height: 96px; }
  .profile-info { gap: 7px; margin-top: 13px; }
  .profile-identity h2 { gap: 5px; font-size: 16px; }
  .profile-identity p { font-size: 11px; }
  .profile-actions { gap: 6px; }
  .profile-actions .button { min-height: 34px; padding: 6px 9px; font-size: 11px; }
  .profile-stats > * { gap: 4px; font-size: 10px; }
  .profile-stats b { font-size: 16px; }
  .profile-bio { font-size: 12px; }
  .connections-header { margin-top: 0; }
  .connection-row { gap: 7px; }
  .connection-profile { gap: 8px; }
  .connection-row > .button { min-width: 76px; padding: 7px 8px; font-size: 10px; }
  .post-dialog { width: 100vw; max-height: 100dvh; border: 0; border-radius: 0; }
  .message-bubble { font-size: 11px; }
  .comment-body { font-size: 10px; }
  .comment-form { gap: 6px; padding: 8px 9px calc(8px + env(safe-area-inset-bottom)); }
  .comment-form input { padding: 9px 10px; font-size: 10px; }
  .comment-form .button { padding: 8px 10px; font-size: 11px; }
  .profile-grid { margin-inline: -12px; gap: 2px; }
  .edit-profile-header h1 { font-size: 20px; }
  .edit-profile-form { padding: 14px; }
  .edit-profile-photo .profile-avatar { width: 68px; height: 68px; font-size: 23px; }
  .settings-card { flex-wrap: wrap; }
  .call-dialog { padding: 17px; }
  .call-media { min-height: 220px; }
  .call-media video { height: 260px; }
}
@media (max-width: 380px) {
  .content { padding: 0 9px; }
  .voice-player { width: 165px; gap: 6px; }
  .voice-play { width: 28px; height: 28px; flex-basis: 28px; }
  .voice-wave { gap: 1px; }
  .call-button { width: 29px; height: 29px; }
  .profile-main { grid-template-columns: 90px minmax(0, 1fr); gap: 10px; }
  .profile-avatar { width: 84px; height: 84px; font-size: 31px; }
  .profile-photo-frame { width: 84px; height: 84px; }
  .profile-stats > * { font-size: 9px; }
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin-inline: auto;
  background: var(--bg);
  box-shadow: 0 0 35px #18172512;
}
.topbar {
  height: 58px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
}
.topbar > .brand { grid-column: 2; justify-self: center; gap: 7px; font-size: 19px; }
.topbar > .brand .brand-logo { width: 30px; height: 30px; }
.top-search, .top-user, .sidebar, .rightbar { display: none !important; }
.header-actions { display: contents; }
.header-actions [data-page="create"] { grid-column: 3; grid-row: 1; justify-self: end; }
.header-actions .notification-button { grid-column: 1; grid-row: 1; justify-self: start; }
.header-action {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}
.header-action svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.header-action.active { color: var(--pink); }
.header-action:active { background: var(--surface-soft); }
.notification-count {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 20px;
  background: #e64968;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}
.layout { width: 100%; display: block; margin: 0 auto 78px; }
.content { width: 100%; padding: 0 12px; }
#feed-page > .section-heading { display: none; }
#profile-page > .section-heading { display: none; }
.stories-panel { padding: 14px 0 10px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.stories-heading { padding: 0 3px; }
.stories-list { gap: 12px; padding: 2px 2px 8px; scrollbar-width: none; }
.stories-list::-webkit-scrollbar { display: none; }
.story-item { width: 64px; flex-basis: 64px; font-size: 10px; }
.story-ring { width: 58px; height: 58px; }
.composer { margin: 8px 0 13px; padding: 13px; border-radius: 13px; }
.composer textarea { min-height: 54px; resize: none; }
.post-card { border-radius: 17px; box-shadow: 0 3px 14px #15141f0a; }
.feed-list { gap: 13px; }
.post-head { padding: 12px 13px; }
.post-image { max-height: 70dvh; object-fit: cover; }
.post-actions { direction: ltr; align-items: center; gap: 5px; padding: 8px 12px 2px; }
.post-action {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  transition: background .18s, transform .18s, color .18s;
}
.post-action:hover { background: var(--surface-soft); transform: translateY(-1px); }
.post-action:active { transform: scale(.92); }
.post-action.like-button { width: 40px; min-width: 40px; padding: 0; border-radius: 50%; font-size: 25px; }
.post-action-icon { width: 22px; height: 22px; }
.post-action.liked .like-icon { animation: heart-pop .24s ease-out; }
@keyframes heart-pop { 50% { transform: scale(1.28); } }
.post-action.save-button { margin-inline-start: auto; }
.save-button.saved { color: var(--accent); }
.post-details { display: grid; gap: 5px; padding: 1px 15px 14px; }
.post-caption { padding: 0; color: var(--text); font-size: 12px; line-height: 1.65; }
.post-caption strong { margin-inline-end: 4px; font-weight: 750; }
.post-time { margin-top: 2px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.post-highlight { animation: post-highlight 1.4s ease; }
@keyframes post-highlight { 40% { background: var(--accent-soft); } }
.mobile-nav {
  position: fixed;
  z-index: 30;
  inset-inline: auto;
  left: 50%;
  bottom: 0;
  width: min(100%, 480px);
  height: calc(59px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(15px);
  transform: translateX(-50%);
}
.mobile-nav button { width: 20%; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); }
.mobile-nav button.active { color: var(--accent); }
.settings-list { gap: 10px; }
.settings-card { min-height: 76px; gap: 11px; padding: 14px; border-radius: 15px; }
.settings-copy { min-width: 0; }
.privacy-settings-card .settings-copy { flex: 1; }
.privacy-toggle { position: relative; width: 48px; height: 28px; flex: 0 0 auto; }
.privacy-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.privacy-toggle-track { position: absolute; inset: 0; border-radius: 20px; background: #c9cbd4; transition: background .2s; }
.privacy-toggle-track::after { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; content: ""; transition: transform .2s; }
.privacy-toggle input:checked + .privacy-toggle-track { background: var(--accent); }
.privacy-toggle input:checked + .privacy-toggle-track::after { transform: translateX(20px); }
.privacy-toggle input:focus-visible + .privacy-toggle-track { outline: 3px solid #7658e855; outline-offset: 2px; }
.settings-requests-card { align-items: flex-start; }
.settings-requests-card .settings-copy { min-width: 0; flex: 1; }
.saved-posts-card { width: 100%; display: flex; text-align: start; cursor: pointer; }
.saved-posts-card .settings-copy { min-width: 0; display: grid; flex: 1; gap: 5px; }
.settings-card-title { color: var(--text); font-size: 14px; font-weight: 700; }
.settings-card-description { color: var(--muted); font-size: 11px; }
.settings-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.saved-posts-arrow { color: var(--muted); font-size: 20px; }
.saved-posts-card:hover { border-color: #cfc5f4; box-shadow: 0 6px 18px #28224410; }
.saved-posts-card:active { transform: scale(.99); }
.follow-requests-list, .saved-posts-list { display: grid; gap: 9px; margin-top: 12px; }
.follow-requests-list > .muted.tiny { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-soft); line-height: 1.5; }
.follow-request-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding-top: 9px; border-top: 1px solid var(--line); }
.follow-request-info { min-width: 100px; display: grid; flex: 1; gap: 3px; font-size: 12px; }
.follow-request-info small { color: var(--muted); }
.follow-request-row .button { padding: 7px 9px; font-size: 11px; }
.saved-posts-list .post-card { border: 1px solid var(--line); border-radius: 12px; }
.private-profile-notice { margin: 0; padding: 13px; border-radius: 11px; background: var(--accent-soft); color: var(--text); font-size: 12px; line-height: 1.7; }
.content-dialog {
  position: fixed;
  width: min(calc(100vw - 24px), 440px);
  max-height: min(82dvh, 680px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px #08080d33;
}
.content-dialog::backdrop { background: #1010189c; backdrop-filter: blur(5px); }
.content-dialog-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: center; min-height: 52px; border-bottom: 1px solid var(--line); background: var(--surface); }
.content-dialog-header h2 { margin: 0; font-size: 15px; }
.content-dialog-header .dialog-close { top: 8px; }
.post-menu-actions { display: grid; gap: 9px; padding: 15px; }
.post-menu-action { width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--surface-soft); color: var(--text); font-size: 13px; font-weight: 700; text-align: start; }
.post-menu-action.danger { display: flex; align-items: center; gap: 9px; color: var(--danger); }
.delete-post-icon { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.edit-post-form, .delete-post-confirm { display: grid; gap: 13px; padding: 15px; }
.edit-post-form label { font-size: 12px; font-weight: 700; }
.edit-post-form textarea { width: 100%; min-height: 120px; resize: vertical; padding: 11px 12px; }
.edit-post-actions { display: flex; justify-content: flex-end; gap: 8px; }
.delete-post-confirm p { margin: 0; font-size: 13px; line-height: 1.7; }
.share-dialog { inset: auto 0 0; width: min(100vw, 480px); max-width: 100vw; max-height: min(82dvh, 680px); margin: 0 auto; border-radius: 20px 20px 0 0; animation: share-sheet-in .22s ease-out; }
.share-dialog::before { position: absolute; z-index: 2; top: 8px; left: calc(50% - 19px); width: 38px; height: 4px; border-radius: 4px; background: var(--line); content: ""; }
.share-dialog .content-dialog-header { min-height: 60px; padding-top: 7px; }
.share-dialog-body { display: grid; gap: 15px; padding: 15px; }
.share-link-preview { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 9px 8px 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); }
.share-link-preview > span { min-width: 0; flex: 1; overflow: hidden; color: var(--muted); font-size: 11px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.share-method:hover { transform: translateY(-1px); opacity: .88; }
.share-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.share-method { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 700; text-decoration: none; transition: transform .18s, background .18s; }
.share-method-button { cursor: pointer; font-family: inherit; text-align: start; }
.share-method-icon { width: 38px; height: 38px; display: grid; flex: 0 0 38px; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--accent); }
.share-method-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.share-section-title { margin: 0; font-size: 13px; }
#share-search { width: 100%; min-height: 42px; padding: 10px 14px; border-radius: 999px; background: var(--surface-soft); font-size: 12px; }
.share-recipients { max-height: min(30dvh, 240px); overflow-y: auto; }
.share-recipient { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 10px; padding: 8px 6px; border: 0; border-radius: 14px; background: transparent; color: var(--text); text-align: start; transition: background .18s, transform .18s; }
.share-recipient:hover { background: var(--surface-soft); transform: translateX(-2px); }
.share-recipient .avatar { width: 42px; height: 42px; }
.share-recipient-info { min-width: 0; display: grid; flex: 1; gap: 3px; font-size: 12px; }
.share-recipient-info small { color: var(--muted); font-size: 10px; }
.share-recipient-send { width: 34px; height: 34px; display: grid; flex: 0 0 34px; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--accent); }
.share-recipient-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes share-sheet-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .share-dialog, .post-action, .post-action.liked .like-icon, .share-method, .share-recipient { animation: none; transition: none; }
}
.comments-dialog { inset: auto 0 0; width: min(100vw, 480px); max-width: 100vw; height: min(66dvh, 560px); min-height: min(400px, 56dvh); max-height: 82dvh; margin: 0 auto; border-radius: 22px 22px 0 0; }
.comments-dialog::before { position: absolute; z-index: 2; top: 8px; left: calc(50% - 19px); width: 38px; height: 4px; border-radius: 4px; background: var(--line); content: ""; }
.comments-dialog .content-dialog-header { min-height: 62px; padding-top: 8px; }
.comments-dialog .content-dialog-header h2 { font-size: 16px; font-weight: 750; letter-spacing: -.2px; }
.comments-dialog .dialog-close { inset-block-start: 13px; inset-inline-end: 12px; width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 22px; transition: background .18s, color .18s, transform .18s; }
.comments-dialog .dialog-close:hover { transform: scale(1.04); background: var(--line); color: var(--text); }
.comments-dialog[open] { display: flex; flex-direction: column; animation: comments-sheet-in .22s ease-out; }
.comments-dialog .comments-list { min-height: 0; max-height: none; flex: 1; }
.comments-list, .notifications-list { max-height: min(58dvh, 480px); overflow-y: auto; padding: 10px 16px; scrollbar-width: thin; overscroll-behavior: contain; }
.comment-row, .notification-row { display: flex; align-items: flex-start; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.comment-row { border-bottom: 0; }
.comment-row .avatar, .notification-row .avatar { width: 36px; height: 36px; font-size: 12px; }
.comment-body, .notification-body { min-width: 0; display: grid; flex: 1; gap: 3px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.comment-author { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 750; line-height: 1.4; }
.comment-text { width: fit-content; max-width: 100%; justify-self: start; font-size: 13px; line-height: 1.55; }
.comment-body small, .notification-body small { color: var(--muted); font-size: 11px; }
.comment-body small { padding-inline: 0; font-size: 10px; }
.comment-form { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -6px 18px #20203a08; }
.comment-form input { min-width: 0; min-height: 44px; flex: 1; padding: 0 15px; border-radius: 999px; background: var(--surface-soft); font-size: 13px; }
.comment-form .button { min-height: 44px; padding: 0 18px; border-radius: 999px; background: linear-gradient(135deg, #7056e8, #d94e9c); box-shadow: 0 5px 13px #9a62dc38; font-size: 12px; }
.comment-form .button:hover { filter: brightness(1.06); transform: translateY(-1px); }
@keyframes comments-sheet-in { from { opacity: .8; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .comments-dialog[open] { animation: none; } }
.notification-row.unread { background: var(--accent-soft); }
.empty-modal-message { padding: 18px 5px; color: var(--muted); font-size: 12px; text-align: center; }
.theme-dark .content-dialog-header { background: var(--surface); }
.auth-screen { min-height: 100dvh; padding: 18px; }
.auth-layout { width: min(100%, 480px); min-height: auto; display: block; }
.auth-story { display: none; }
.auth-card { max-width: 430px; margin: 0 auto; padding: 27px 22px; }
.story-dialog { height: 100dvh; max-height: 100dvh; border-radius: 0; }

.discover-heading { gap: 16px; margin: 6px 2px 18px; }
.discover-heading .eyebrow { margin-bottom: 5px; }
.discover-heading h1 { font-size: clamp(25px, 6vw, 30px); line-height: 1.15; }
.discover-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.discover-heading-mark {
  width: 46px; height: 46px; display: grid; flex: 0 0 46px; place-items: center;
  border-radius: 16px; background: linear-gradient(145deg, #7658e8, #df4f9a);
  color: #fff; box-shadow: 0 8px 18px #9a55d52e;
}
.discover-heading-mark svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.discover-search-card { display: grid; gap: 9px; padding: 14px; border-radius: 16px; }
.discover-search-card label { margin: 0 2px; color: var(--text); font-size: 12px; }
.discover-search-field {
  min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft);
  transition: border-color .18s, box-shadow .18s;
}
.discover-search-field:focus-within { border-color: #8a67eb; box-shadow: 0 0 0 3px #8a67eb20; }
.discover-search-field svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.discover-search-field input { min-width: 0; min-height: 44px; flex: 1; padding: 10px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 13px; }
.discover-search-field input:focus { border: 0; box-shadow: none; }
.people-list { margin-top: 12px; }
.discover-empty {
  min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border: 1px dashed var(--line); border-radius: 15px; background: var(--surface);
}
.discover-empty-icon {
  width: 42px; height: 42px; display: grid; flex: 0 0 42px; place-items: center;
  border-radius: 14px; background: #815ce81a; color: #7658e8;
}
.discover-empty-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.discover-empty strong { color: var(--text); font-size: 12px; line-height: 1.5; }
.discover-posts-heading { display: flex; align-items: center; gap: 8px; margin: 22px 2px 12px; color: var(--text); font-size: 16px; }
.discover-posts-heading::before { width: 4px; height: 17px; border-radius: 4px; background: linear-gradient(#7658e8, #df4f9a); content: ""; }
.discover-grid { gap: 6px; }
.discover-grid .grid-image { border-radius: 9px; transition: transform .16s ease; }
.discover-grid .grid-image:active { transform: scale(.985); }
.discover-posts-empty {
  min-height: 148px; grid-column: 1 / -1; display: grid; justify-items: center; align-content: center;
  gap: 10px; padding: 22px; border: 1px dashed var(--line); border-radius: 15px;
  background: var(--surface); color: var(--muted); font-size: 12px; text-align: center;
}
.discover-posts-empty svg { width: 32px; height: 32px; fill: none; stroke: #8a67eb; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-dark .discover-empty, .theme-dark .discover-posts-empty { background: var(--surface); }
.theme-dark .discover-empty-icon { background: #302748; color: #c1a8ff; }
@media (prefers-reduced-motion: reduce) {
  .discover-search-field, .discover-grid .grid-image { transition: none; }
}

.stories-heading { align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.story-expiry {
  max-width: 68%; display: flex; align-items: center; gap: 5px; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--muted); font-size: 9px; line-height: 1.3; white-space: nowrap;
}
.story-expiry > span { overflow: hidden; text-overflow: ellipsis; }
.story-expiry svg { width: 13px; height: 13px; flex: 0 0 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.story-item { transition: transform .16s ease, color .16s ease; }
.story-item:active { transform: scale(.96); }
.mobile-nav button { position: relative; }
.mobile-nav button::before {
  position: absolute; width: 40px; height: 32px; border-radius: 11px;
  background: transparent; content: ""; transition: background .16s ease;
}
.mobile-nav button.active { color: #7658e8; }
.mobile-nav button.active::before { background: #7658e81a; }
.mobile-nav button svg { position: relative; width: 21px; height: 21px; }
.theme-dark .mobile-nav button.active { color: #c1a8ff; }
.theme-dark .mobile-nav button.active::before { background: #c1a8ff1b; }
@media (prefers-reduced-motion: reduce) {
  .story-item, .mobile-nav button::before { transition: none; }
}
.post-profile-trigger {
  min-width: 0; padding: 0; border: 0; background: transparent; color: inherit;
  font: inherit; text-align: start;
}
.post-profile-avatar {
  width: 43px; height: 43px; display: grid; flex: 0 0 43px; place-items: center;
  padding: 0; border: 0; border-radius: 50%; background: transparent;
}
.post-profile-avatar .avatar { width: 39px; height: 39px; }
.post-identity { cursor: pointer; }
.post-identity strong { display: flex; align-items: center; gap: 3px; }
.post-identity:hover strong { text-decoration: underline; text-underline-offset: 2px; }
.post-profile-avatar:active, .post-identity:active { opacity: .78; }
.story-ring.story-seen, .story-avatar-ring.story-seen, .profile-photo-frame.has-story.story-seen { background: #c5c8d0; }
.theme-dark .story-ring.story-seen, .theme-dark .story-avatar-ring.story-seen,
.theme-dark .profile-photo-frame.has-story.story-seen { background: #555a66; }
