/* PAGES social layer — dark, smooth, native-feeling. Hand-written, no framework. */
body { background: var(--bg); color: var(--text); }
.screen-h { font-family: var(--font-display); font-size: 28px; margin: 6px 0 14px; }
.section-h { font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-soft); margin: 22px 0 10px; }
.center { text-align: center; }
.btn.small { padding: 8px 14px; font-size: 14px; min-height: 44px; }
.btn.big { width: 100%; padding: 16px; font-size: 17px; }
.btn.danger { color: var(--pl-danger); border-color: var(--pl-danger); }
.btn.coming { opacity: .55; }
.google-btn { background: #fff; color: #1a1a1a; border: none; font-weight: 600; }
.or-row { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 14px 0; }
.or-row::before, .or-row::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 36px 18px; color: var(--text-soft); }
.empty h3 { color: var(--text); font-family: var(--font-display); font-size: 22px; }
.empty .btn { margin-top: 12px; display: inline-block; }
.card.link-card { display: block; text-decoration: none; color: var(--text); margin-top: 16px; }
.tabbar .create-tab .ic { background: var(--accent); color: #fff; border-radius: 10px; padding: 1px 9px; }
.tab-badge { background: var(--accent); color: #fff; font-size: 10px; border-radius: 8px; padding: 1px 6px; margin-left: 4px; vertical-align: top; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 18px; min-width: 44px; min-height: 44px; cursor: pointer; }

/* avatars */
.avatar { border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; flex: none; }
.avatar-fallback { background: linear-gradient(140deg, var(--accent), #5e141a); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

/* stories */
.stories-row { display: flex; gap: 14px; overflow-x: auto; padding: 8px 2px 14px; scrollbar-width: none; }
.stories-row::-webkit-scrollbar { display: none; }
.story-ring { background: none; border: none; color: var(--text); display: flex; flex-direction: column;
  align-items: center; gap: 5px; cursor: pointer; position: relative; flex: none; padding: 2px; }
.story-ring .avatar { outline: 3px solid var(--accent); outline-offset: 2px; }
.story-ring.viewed .avatar { outline-color: var(--line); }
.story-ring label { font-size: 11px; color: var(--text-soft); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-ring .plus { position: absolute; right: 2px; top: 34px; background: var(--accent); color: #fff;
  width: 20px; height: 20px; border-radius: 50%; font-size: 15px; line-height: 20px; }
.story-viewer { position: fixed; inset: 0; background: #000; z-index: 60; display: flex; flex-direction: column; }
.story-progress { display: flex; gap: 4px; padding: 10px 12px 4px; }
.story-progress span { flex: 1; height: 3px; background: rgba(255,255,255,.3); border-radius: 2px; }
.story-progress span.done { background: #fff; }
.story-progress span.now { background: var(--accent-2); }
.story-head { display: flex; align-items: center; gap: 9px; padding: 8px 14px; color: #fff; }
.story-head span { color: #bbb; font-size: 13px; }
.story-head .close { margin-left: auto; color: #fff; }
.story-stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.story-stage img, .story-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.story-overlay { position: absolute; bottom: 12%; left: 6%; right: 6%; text-align: center; color: #fff;
  font-size: 26px; font-weight: 800; text-shadow: 0 2px 14px rgba(0,0,0,.8); }
.story-caption { color: #eee; text-align: center; padding: 10px 16px 22px; }
.story-nav { position: absolute; top: 50%; background: rgba(255,255,255,.12); color: #fff; border: none;
  width: 44px; height: 64px; font-size: 26px; border-radius: 10px; cursor: pointer; }
.story-nav.prev { left: 8px; } .story-nav.next { right: 8px; }
.filter-vivid { filter: saturate(1.5) contrast(1.1); }
.filter-warm { filter: sepia(.35) saturate(1.2); }
.filter-noir { filter: grayscale(1) contrast(1.15); }
.filter-fade { filter: contrast(.9) brightness(1.08) saturate(.8); }
.filter-royal { filter: hue-rotate(-12deg) saturate(1.35) contrast(1.05); }

/* feed */
.feed-modes { display: flex; gap: 8px; margin: 4px 0 14px; }
.feed-modes button { flex: 1; min-height: 44px; background: var(--surface); color: var(--text-soft);
  border: 1px solid var(--line); border-radius: 999px; font-size: 15px; cursor: pointer; }
.feed-modes button.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; margin-bottom: 14px; }
.repost-note { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-who { display: flex; flex-direction: column; min-width: 0; }
.post-name { color: var(--text); font-weight: 700; text-decoration: none; }
.post-meta { color: var(--muted); font-size: 13px; }
.post-menu { margin-left: auto; }
.post-body { font-size: 16px; line-height: 1.45; margin: 10px 0; white-space: pre-wrap; word-break: break-word; }
.post-media { position: relative; border-radius: 12px; overflow: hidden; margin: 8px 0; background: #000; }
.post-media img, .post-media video { width: 100%; display: block; max-height: 560px; object-fit: cover; }
.sound-btn { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.55); color: #fff;
  border: none; border-radius: 50%; width: 44px; height: 44px; font-size: 18px; cursor: pointer; }
.post-actions { display: flex; gap: 6px; margin-top: 8px; }
.post-actions .act { background: none; border: none; color: var(--text-soft); font-size: 16px;
  min-height: 44px; min-width: 56px; cursor: pointer; border-radius: 10px; }
.post-actions .act.on { color: var(--accent); }
.reply-box { display: flex; gap: 8px; margin-top: 10px; }
.reply-box input { flex: 1; }

/* profile pages */
.pagewrap { --page-accent: var(--accent); --page-bg: var(--bg); --page-font: var(--font-body);
  font-family: var(--page-font); margin: -16px -16px 0; padding: 0 16px 20px; }
.pagewrap.has-bg { background-attachment: scroll; }
.page-banner { height: 150px; margin: 0 -16px; background: linear-gradient(150deg, var(--page-accent), #1a1a26);
  background-size: cover; background-position: center; }
.page-head { display: flex; gap: 14px; align-items: flex-end; margin-top: -34px; }
.page-head .avatar { outline: 4px solid var(--bg); }
.page-id h2 { margin: 0; font-size: 24px; }
.handle { color: var(--accent-2); font-size: 14px; }
.bio { color: var(--text-soft); margin: 6px 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.page-actions .btn { min-height: 44px; }
.top8 h3 { color: var(--page-accent); }
.top8-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.top8-grid a { display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--text); text-decoration: none; font-size: 12px; }
.custom-frame { width: 100%; min-height: 180px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: rgba(0,0,0,.25); margin: 14px 0; }
.pkg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pkg { background: var(--pkgbg); border: 1px solid var(--pkg); color: var(--text); border-radius: 12px;
  padding: 14px; text-align: left; cursor: pointer; min-height: 64px; display: flex; flex-direction: column; gap: 3px; }
.pkg b { color: var(--pkg); } .pkg span { font-size: 12px; color: var(--text-soft); }
.top8-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.top8-pick .pick { background: var(--surface-2); border: 2px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; min-width: 64px; min-height: 44px; }
.top8-pick .pick.on { border-color: var(--accent-2); }
textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; width: 100%;
  background: #0a0a12; color: #b8f0c8; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }

/* create */
.create-modes { display: flex; gap: 8px; margin-bottom: 14px; }
.create-modes a { flex: 1; text-align: center; padding: 12px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--text-soft); text-decoration: none; min-height: 44px; }
.create-modes a.on { background: var(--accent); color: #fff; font-weight: 600; }
.camera-box { position: relative; background: #000; border-radius: var(--r-md); overflow: hidden;
  min-height: 320px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.camera-box video, .camera-box img { width: 100%; max-height: 520px; object-fit: contain; display: block; }
.cam-empty { text-align: center; padding: 30px 16px; color: var(--text-soft); display: flex;
  flex-direction: column; gap: 12px; align-items: center; }
.cam-controls { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; gap: 8px;
  justify-content: center; flex-wrap: wrap; padding: 0 10px; }
.overlay-preview { position: absolute; bottom: 14%; left: 6%; right: 6%; text-align: center; color: #fff;
  font-size: 24px; font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,.8); pointer-events: none; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 16px; min-height: 44px; cursor: pointer; text-transform: capitalize; }
.chip.on { background: var(--accent-2); color: #1a1405; font-weight: 700; border-color: var(--accent-2); }
.trim-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.trim-row input[type=range] { flex: 1; min-height: 44px; }
.file-btn { cursor: pointer; }

/* people + messages */
.person-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.person-id { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.person-id a { color: var(--text); text-decoration: none; }
.person-id span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--text); min-height: 64px; }
.conv-id { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.conv-last { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--muted); font-size: 12px; }
.badge { background: var(--accent); color: #fff; border-radius: 9px; padding: 1px 7px; font-size: 12px; }
.threadwrap { display: flex; flex-direction: column; height: calc(100dvh - 190px); }
.thread-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.thread-head .back { color: var(--text); font-size: 26px; text-decoration: none; min-width: 44px; min-height: 44px; }
.thread-who { display: flex; align-items: center; gap: 8px; }
.thread-who span { color: var(--muted); font-size: 13px; }
.thread-msgs { flex: 1; overflow-y: auto; padding: 14px 2px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 18px; }
.bubble p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.bubble span { font-size: 11px; opacity: .65; }
.bubble.mine { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.bubble.theirs { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.thread-composer { display: flex; gap: 8px; padding-top: 10px; }
.thread-composer input { flex: 1; min-height: 48px; }
input[type=search], input[type=text], input[type=email], textarea, select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; font-size: 16px; }
input[type=color] { width: 64px; height: 44px; background: none; border: 1px solid var(--line); border-radius: 8px; }

.reply-box[hidden] { display: none !important; }
.btn { text-decoration: none; text-align: center; }
a.btn { display: inline-block; }
.post-actions .act { font-size: 19px; }
