/* ============================================================
   Chokhu mini-app

   Two surfaces, not one. The feed is black edge to edge because video decides
   its own colour and any chrome has to get out of the way; the inbox and the
   profile are light, the way every short-video app builds them, because a list
   of names read on a black background is a worse list. The wallet's yellow
   appears nowhere — a partner owns its own surface, which is the same point
   Bun Adda's cream makes from the other direction.
   ============================================================ */
:root {
  --ck-coral: #FF5E4D;
  --ck-magenta: #D61F8D;
  --ck-ink: #16161A;
  --ck-dim: rgba(255, 255, 255, 0.62);
}

.ck-app {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
  background: #FFF;
  overflow: hidden;
}
.ck-app.is-feed { background: #000; }

/* ---------- host chrome ---------- */
.ck-capsule {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 3px;
  border-radius: var(--radius-pill);
  background: rgba(22, 22, 26, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  color: #FFF;
  flex-shrink: 0;
}
.ck-capsule-btn {
  width: 30px; height: 26px;
  border: none; background: none;
  display: flex; align-items: center; justify-content: center;
  color: inherit;
  cursor: pointer;
}
.ck-capsule-btn:active { transform: scale(0.9); }
.ck-capsule-split { width: 1px; height: 15px; background: rgba(255, 255, 255, 0.28); }

/* On the light pages the same capsule needs the opposite treatment. */
.ck-page .ck-capsule,
.ck-me-card ~ * .ck-capsule {
  background: rgba(22, 22, 26, 0.06);
  border-color: rgba(22, 22, 26, 0.10);
  color: var(--ck-ink);
}
.ck-page .ck-capsule-split { background: rgba(22, 22, 26, 0.16); }
.ck-me-top .ck-capsule {
  background: rgba(22, 22, 26, 0.28);
  border-color: rgba(255, 255, 255, 0.24);
  color: #FFF;
}
.ck-me-top .ck-capsule-split { background: rgba(255, 255, 255, 0.3); }

.ck-iconbtn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; padding: 0;
  color: #FFF;
  cursor: pointer;
}
.ck-iconbtn:active { transform: scale(0.9); }
.ck-iconbtn.dark { color: var(--ck-ink); }

.ck-sheet-rows { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.ck-sheet-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 4px;
  border: none; background: none;
  font-size: 15px; color: var(--color-text-main);
  cursor: pointer; text-align: left;
}
.ck-sheet-row:active { background: var(--color-bg-floating); border-radius: 10px; }
.ck-sheet-note {
  display: flex; align-items: center; gap: 7px;
  margin-top: 10px; padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 12px; color: var(--color-text-muted);
}

/* ---------- feed ---------- */
.ck-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 0;
  pointer-events: none;
}
.ck-topbar > * { pointer-events: auto; }

.ck-tabs { display: flex; align-items: center; gap: 15px; min-width: 0; }
.ck-tab {
  position: relative;
  border: none; background: none; padding: 4px 0;
  font-size: 15px; font-weight: 600;
  color: rgba(255, 255, 255, 0.66);
  white-space: nowrap;
  cursor: pointer;
}
.ck-tab.on { color: #FFF; font-weight: 700; }
.ck-tab.on::after {
  content: '';
  position: absolute; left: 50%; bottom: -3px;
  width: 17px; height: 2.5px; margin-left: -8.5px;
  border-radius: 2px;
  background: #FFF;
}
.ck-topright { display: flex; align-items: center; gap: 4px; }

.ck-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ck-feed::-webkit-scrollbar { display: none; }

.ck-slide {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  overflow: hidden;
}
.ck-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.ck-slide.ck-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--ck-dim); font-size: 14px;
}

/* Scrims. They exist for legibility, and they also cover the corners the
   source footage had a watermark in — belt and braces, since the inpainting
   that removed it can leave a faint smudge on a busy frame. */
.ck-scrim { position: absolute; left: 0; right: 0; pointer-events: none; }
.ck-scrim-top {
  top: 0; height: 168px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}
.ck-scrim-bottom {
  bottom: 0; height: 320px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
}

.ck-playpause {
  position: absolute;
  inset: 0;
  width: 100%;
  border: none; background: none; padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 1;
}
.ck-playmark {
  color: rgba(255, 255, 255, 0.82);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.18s ease, transform 0.18s ease;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}
.ck-slide.paused .ck-playmark { opacity: 1; transform: scale(1); }

/* ---------- right rail ---------- */
.ck-rail {
  position: absolute;
  right: 9px;
  bottom: 104px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
  color: #FFF;
}
.ck-avatar-wrap { position: relative; margin-bottom: 5px; }
.ck-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--tint, var(--ck-magenta));
  border: 2px solid #FFF;
  color: #FFF;
  font-size: 17px; font-weight: 700;
}
.ck-avatar.sm { width: 34px; height: 34px; font-size: 13px; border: none; }
.ck-avatar.lg { width: 56px; height: 56px; font-size: 20px; border: none; }
.ck-avatar.xl { width: 78px; height: 78px; font-size: 28px; border-width: 3px; }

.ck-follow {
  position: absolute;
  left: 50%; bottom: -8px;
  transform: translateX(-50%);
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: var(--ck-coral);
  color: #FFF;
  cursor: pointer;
  padding: 0;
}
.ck-follow.on { background: #FFF; color: var(--ck-coral); }
.ck-follow:active { transform: translateX(-50%) scale(0.86); }

.ck-railbtn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: none; background: none; padding: 0;
  color: #FFF;
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}
.ck-railbtn.on { color: #FF2D55; }
.ck-railbtn.on.save { color: #FFC531; }
.ck-railnum { font-size: 11.5px; font-weight: 600; }
.ck-railbtn:active { transform: scale(0.88); }
.ck-railbtn.pop svg { animation: ckPop 0.42s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes ckPop {
  0% { transform: scale(1); }
  38% { transform: scale(1.32); }
  100% { transform: scale(1); }
}

.ck-disc {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2b2b30, #0c0c0e);
  border: 5px solid #17171b;
  color: #FFF;
  animation: ckSpin 5.5s linear infinite;
}
@keyframes ckSpin { to { transform: rotate(360deg); } }

/* ---------- caption ---------- */
.ck-caption {
  position: absolute;
  left: 13px;
  right: 74px;
  bottom: 74px;
  z-index: 3;
  color: #FFF;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.ck-handle { font-size: 15px; font-weight: 700; }
.ck-text { font-size: 13.5px; line-height: 1.42; margin-top: 5px; }
.ck-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 5px; }
.ck-tags span { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.9); }
.ck-music {
  display: flex; align-items: center; gap: 6px;
  margin-top: 9px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.86);
}
.ck-music span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sits above the caption, not under the tab row where it read as a stray
   toast — and it retires itself, because a hint that never leaves stops being
   a hint and becomes furniture. The speaker button in the top bar is the
   permanent control. */
.ck-unmute {
  position: absolute;
  left: 50%; bottom: 176px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(22, 22, 26, 0.5);
  backdrop-filter: blur(8px);
  color: #FFF;
  font-size: 12px;
  cursor: pointer;
  transition: opacity 0.45s ease;
}
.ck-unmute.gone { opacity: 0; pointer-events: none; }

/* ---------- comments sheet ---------- */
.ck-cm { display: flex; flex-direction: column; max-height: 68vh; }
.ck-cm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px; color: var(--color-text-muted);
}
.ck-cm-head b { color: var(--color-text-main); }
.ck-cm-list { flex: 1; overflow-y: auto; padding: 6px 0 4px; }
.ck-cm-row { display: flex; gap: 10px; padding: 11px 0; }
.ck-cm-body { flex: 1; min-width: 0; }
.ck-cm-author { font-size: 12.5px; color: var(--color-text-muted); }
.ck-cm-text { font-size: 14px; line-height: 1.45; margin-top: 2px; color: var(--color-text-main); }
.ck-cm-meta {
  display: flex; align-items: center; gap: 14px;
  margin-top: 5px;
  font-size: 12px; color: var(--color-text-muted);
}
.ck-cm-reply, .ck-cm-more {
  border: none; background: none; padding: 0;
  font-size: 12px; font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
}
.ck-cm-more { margin-top: 7px; color: var(--ck-magenta); }
.ck-cm-like {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: none; padding: 2px 0 0;
  font-size: 11px; color: var(--color-text-muted);
  cursor: pointer;
}
.ck-cm-empty { padding: 34px 0; text-align: center; color: var(--color-text-muted); font-size: 14px; }
.ck-cm-input {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 6px;
  padding: 11px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-floating);
  cursor: pointer;
}
.ck-cm-placeholder { font-size: 13.5px; color: var(--color-text-muted); }
.ck-cm-tools { display: flex; gap: 10px; color: var(--color-text-muted); }

/* ---------- light pages (inbox, me) ---------- */
.ck-page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #FFF;
  padding-bottom: 12px;
}
.ck-pagebar {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px;
  background: #FFF;
}
.ck-pagebar.transparent { background: none; position: static; }
.ck-pagetitle { font-size: 16px; font-weight: 700; color: var(--ck-ink); }

.ck-stories {
  display: flex; gap: 16px;
  padding: 6px 14px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ck-stories::-webkit-scrollbar { display: none; }
.ck-story { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; width: 62px; }
.ck-story-ring {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 2px;
  border-radius: 50%;
  border: 2px solid rgba(22, 22, 26, 0.12);
}
.ck-story-ring.self { border-color: transparent; }
.ck-story-add {
  position: absolute; right: -1px; bottom: -1px;
  width: 19px; height: 19px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #12B76A;
  border: 2px solid #FFF;
  color: #FFF;
}
.ck-story-name {
  font-size: 11.5px; color: var(--color-text-muted);
  max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ck-threads { display: flex; flex-direction: column; }
.ck-thread {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border: none; background: none;
  text-align: left;
  cursor: pointer;
}
.ck-thread:active { background: var(--color-bg-floating); }
.ck-thread-mark {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--tint, var(--ck-magenta));
  color: #FFF;
  font-size: 18px; font-weight: 700;
}
.ck-thread-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ck-thread-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ck-thread-name {
  font-size: 15px; font-weight: 600; color: var(--ck-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ck-thread-when { font-size: 12px; color: var(--color-text-muted); flex-shrink: 0; }
.ck-thread-last {
  font-size: 13px; color: var(--color-text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ck-thread-dot {
  min-width: 19px; height: 19px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  background: #FF2D55;
  color: #FFF;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}

/* ---------- me ---------- */
.ck-me-top {
  padding: 0 0 20px;
  background: linear-gradient(150deg, var(--ck-coral), var(--ck-magenta));
  color: #FFF;
}
.ck-me-id { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 16px 0; }
.ck-me-name { font-size: 19px; font-weight: 700; margin-top: 4px; }
.ck-me-handle { font-size: 12.5px; color: rgba(255, 255, 255, 0.82); }

.ck-me-card {
  margin: -14px 12px 0;
  padding: 16px 14px;
  border-radius: 16px;
  background: #FFF;
  box-shadow: 0 6px 20px rgba(22, 22, 26, 0.10);
}
.ck-me-stats { display: flex; align-items: center; gap: 18px; }
.ck-me-stat { display: flex; flex-direction: column; }
.ck-me-stat b { font-size: 17px; color: var(--ck-ink); }
.ck-me-stat span { font-size: 11.5px; color: var(--color-text-muted); }
.ck-me-edit {
  margin-left: auto;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: none;
  font-size: 13px; font-weight: 600; color: var(--ck-ink);
  cursor: pointer;
}
.ck-me-bio { margin-top: 12px; font-size: 13.5px; line-height: 1.45; color: var(--color-text-main); }
.ck-me-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ck-me-chips span {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-floating);
  font-size: 11.5px; color: var(--color-text-muted);
}

.ck-me-tabs {
  display: flex; gap: 22px;
  padding: 16px 16px 10px;
}
.ck-me-tabs button {
  position: relative;
  border: none; background: none; padding: 2px 0;
  font-size: 14px; font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
}
.ck-me-tabs button.on { color: var(--ck-ink); }
.ck-me-tabs button.on::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -5px;
  height: 2.5px; border-radius: 2px;
  background: var(--ck-ink);
}

.ck-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 0 2px; }
.ck-cell {
  position: relative;
  aspect-ratio: 3 / 4;
  border: none; padding: 0;
  background: var(--color-bg-floating);
  overflow: hidden;
  cursor: pointer;
}
.ck-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ck-cell-views {
  position: absolute; left: 6px; bottom: 5px;
  display: flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: #FFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.ck-hostnote {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 18px 16px 6px;
  font-size: 11.5px; color: var(--color-text-muted);
}

/* ---------- the mini-app's own tab bar ---------- */
.ck-tabbar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 7px 0 calc(7px + env(safe-area-inset-bottom, 0px));
  background: #FFF;
  border-top: 1px solid var(--color-border);
}
.ck-app.is-feed .ck-tabbar {
  background: #000;
  border-top-color: rgba(255, 255, 255, 0.10);
}
.ck-tabbtn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: none; background: none; padding: 2px 0;
  color: var(--color-text-muted);
  cursor: pointer;
}
.ck-app.is-feed .ck-tabbtn { color: rgba(255, 255, 255, 0.55); }
.ck-tabbtn.on { color: var(--ck-ink); }
.ck-app.is-feed .ck-tabbtn.on { color: #FFF; }
.ck-tabicon { position: relative; display: flex; }
.ck-tablabel { font-size: 10.5px; font-weight: 600; }
.ck-badge {
  position: absolute; top: -4px; right: -9px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  background: #FF2D55;
  color: #FFF;
  font-size: 10px; font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .ck-disc { animation: none; }
  .ck-railbtn.pop svg { animation: none; }
  .ck-playmark { transition: none; }
}
