/* gram — "{name}gram" reels feed. Prefix: .g- */

body[data-view="gram"] {
  background: var(--g-bg);
  color: var(--g-text);
  color-scheme: dark;
}
.view-gram {
  --g-frame-w: 100%;
  --g-top-h: calc(56px + env(safe-area-inset-top));
  /* reels can use these to keep clear of the overlays */
  --g-safe-top: calc(64px + env(safe-area-inset-top));
  --g-safe-bottom: calc(92px + env(safe-area-inset-bottom));
  --g-safe-right: 64px;
  background: var(--g-bg);
  color: var(--g-text);
  min-height: 100dvh;
}
@media (min-width: 600px) {
  .view-gram { --g-frame-w: min(100%, 480px, calc(100dvh * 0.5625)); }
}

/* ---------- top bar ---------- */
.g-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  pointer-events: none;
  display: flex; justify-content: center;
}
.g-top-in {
  width: var(--g-frame-w);
  display: flex; align-items: center; gap: 6px;
  padding: env(safe-area-inset-top) 12px 0 6px;
  height: var(--g-top-h);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}
.g-top-title { display: flex; flex-direction: column; line-height: 1.1; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }
.g-top-name { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.g-top-handle { font-size: 12px; color: var(--g-muted); }

.g-iconbtn {
  pointer-events: auto;
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--g-text);
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out);
}
.g-iconbtn:active { transform: scale(0.88); }
.g-ico { width: 26px; height: 26px; fill: currentColor; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45)); }

/* ---------- feed ---------- */
.g-feed {
  position: fixed; inset: 0;
  height: 100dvh;
  overflow-x: hidden; overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.g-feed::-webkit-scrollbar { display: none; }
.g-slide {
  position: relative;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex; justify-content: center;
  overflow: hidden;
}
.g-frame {
  position: relative;
  width: var(--g-frame-w);
  height: 100%;
  overflow: hidden;
  background: #0b0b0f;
}
@media (min-width: 600px) {
  .g-frame { border-left: 1px solid #1c1c22; border-right: 1px solid #1c1c22; }
}

/* ---------- avatar + gradient ring ---------- */
.g-avatar {
  position: relative; display: inline-grid; place-items: center;
  border-radius: 50%; flex: none;
  background: var(--g-gradient);
}
.g-avatar-in {
  position: relative; display: grid; place-items: center;
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: #222; border: 3px solid var(--g-bg);
}
.g-avatar-initial { font-weight: 800; color: #fff; }
.g-avatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 300ms;
}
.g-avatar-img.is-loaded { opacity: 1; }
.g-avatar-sm { width: 30px; height: 30px; padding: 2px; }
.g-avatar-sm .g-avatar-in { border-width: 1.5px; }
.g-avatar-sm .g-avatar-initial { font-size: 12px; }


/* ---------- profile page (laid out like a real reels app) ---------- */
.g-pp {
  position: fixed; inset: 0; z-index: 1;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  width: var(--g-frame-w); margin: 0 auto;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  background: var(--g-bg);
  scrollbar-width: none;
}
.g-pp::-webkit-scrollbar { display: none; }
@media (min-width: 600px) { .g-pp { border-left: 1px solid #1c1c22; border-right: 1px solid #1c1c22; } }
.g-pp-bar {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; gap: 4px;
  padding: env(safe-area-inset-top) 4px 0;
  height: calc(52px + env(safe-area-inset-top));
  background: rgba(0, 0, 0, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.g-pp-bar .g-ico { filter: none; }
.g-pp-title { flex: 1; display: flex; align-items: center; gap: 5px; min-width: 0; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.g-pp-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-pp-title .g-ico { width: 16px; height: 16px; flex: none; }
.g-pp-more { pointer-events: none; }

.g-pp-head { display: flex; align-items: center; gap: 20px; padding: 8px 16px 0; animation: fade-up 420ms var(--ease-out) both; }
.g-pp-avatar { flex: none; padding: 0; border: 0; background: none; border-radius: 50%; }
.g-avatar-lg { width: 88px; height: 88px; padding: 3px; background: conic-gradient(from 200deg, #f9ce34, #ee2a7b, #6228d7, #ee2a7b, #f9ce34); }
.g-avatar-lg .g-avatar-in { border-width: 3px; }
.g-avatar-lg .g-avatar-initial { font-size: 34px; }
.g-avatar-xs { width: 20px; height: 20px; padding: 0; background: none; }
.g-avatar-xs .g-avatar-in { border-width: 0; }
.g-avatar-xs .g-avatar-initial { font-size: 9px; }
.g-stats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; text-align: center; }
.g-stat { display: flex; flex-direction: column; line-height: 1.2; }
.g-stat b { font-size: 18px; font-weight: 700; }
.g-stat span { font-size: 13px; color: var(--g-text); }

.g-pp-bio { padding: 12px 16px 0; font-size: 14px; line-height: 1.4; animation: fade-up 420ms var(--ease-out) 60ms both; }
.g-pp-name { margin: 0; font-weight: 700; }
.g-pp-text { margin: 2px 0 0; white-space: pre-line; }
.g-pp-followed { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; color: var(--g-muted); }

.g-pp-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 14px 16px 0; animation: fade-up 420ms var(--ease-out) 120ms both; }
.g-pbtn {
  min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px;
  background: #262629; color: #fff; font-size: 14px; font-weight: 600;
  transition: background 160ms, transform 160ms var(--ease-out);
}
.g-pbtn:active { transform: scale(0.97); background: #333338; }

.g-hls { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 16px 16px 2px; }
.g-hls::-webkit-scrollbar { display: none; }
.g-hl { flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 66px; }
.g-hl-ring { display: block; width: 64px; height: 64px; border-radius: 50%; padding: 2px; background: #3a3a40; }
.g-hl-in { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #1a1a1e; border: 2px solid var(--g-bg); }
.g-hl-emoji { font-size: 24px; }
.g-hl-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.g-hl-img:not([src]) { display: none; }
.g-hl-label { font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.g-pp-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-top: 14px; border-top: 1px solid #262629; }
.g-pp-tab { display: grid; place-items: center; height: 46px; color: var(--g-muted); border-top: 1px solid transparent; margin-top: -1px; }
.g-pp-tab .g-ico { width: 24px; height: 24px; filter: none; }
.g-pp-tab.is-on { color: #fff; border-top-color: #fff; }

.g-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.g-tile {
  position: relative; aspect-ratio: 9 / 16; border: 0; padding: 0; border-radius: 0;
  background: var(--g-gradient); background-size: cover; background-position: center;
  display: grid; place-items: center; overflow: hidden; color: #fff;
  animation: fade-up 420ms var(--ease-out) both;
}
.g-tile:nth-child(3n + 2) { animation-delay: 60ms; }
.g-tile:nth-child(3n) { animation-delay: 120ms; }
.g-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 40%); }
.g-tile:not(.has-thumb)::after { background: rgba(0, 0, 0, 0.18); }
.g-tile-ico { position: relative; z-index: 1; font-size: 30px; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.5)); }
.g-tile.has-thumb .g-tile-ico { display: none; }
.g-tile-views {
  position: absolute; z-index: 1; left: 6px; bottom: 6px;
  display: flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.g-tile-views .g-ico { width: 14px; height: 14px; }
.g-tile:active { filter: brightness(0.85); }
.g-tile:nth-child(1) { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0); animation: fade-up 420ms var(--ease-out) both, g-first 2.4s ease-in-out 1.2s infinite; }
@keyframes g-first { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0); } 50% { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85); } }
.g-pp-empty, .g-pp-hint { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--g-muted); }

/* ---------- feed overlay ---------- */
.g-feedwrap { position: fixed; inset: 0; z-index: 5; background: var(--g-bg); }
.g-feedwrap.is-open { animation: g-open 320ms var(--ease-out) both; }
@keyframes g-open { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

/* ---------- reel slide ---------- */
.g-stage {
  position: absolute; inset: 0;
  z-index: 0; /* own stacking context: reel content never covers caption/rail */
  overflow: hidden;
  background: #0b0b0f;
  color: var(--g-text);
}
.g-scrim {
  position: absolute; left: 0; right: 0; bottom: 0; height: 180px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
  pointer-events: none; z-index: 2;
}
.g-caption {
  position: absolute; z-index: 3;
  left: 14px; right: var(--g-safe-right); bottom: calc(18px + env(safe-area-inset-bottom));
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.g-cap-who { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.g-cap-text {
  margin: 6px 0 0; font-size: 14px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.g-rail {
  position: absolute; z-index: 3;
  right: 6px; bottom: calc(72px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none;
}
.g-rail-item { position: relative; display: flex; flex-direction: column; align-items: center; }
.g-rail-label { font-size: 12px; font-weight: 600; margin-top: -4px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.g-like .g-ico { transition: transform 260ms var(--ease-spring), fill 160ms; }
.g-like[aria-pressed="true"] { color: var(--g-accent); }
.g-like[aria-pressed="true"] .g-ico { animation: g-pop 420ms var(--ease-spring); }
@keyframes g-pop { 0% { transform: scale(0.6); } 55% { transform: scale(1.3); } 100% { transform: scale(1); } }
.g-burst {
  position: absolute; left: 50%; top: 22px; z-index: 4;
  font-size: 12px; color: var(--g-accent); pointer-events: none;
  animation: g-burst var(--d, 420ms) var(--ease-out) forwards;
}
@keyframes g-burst {
  from { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1); opacity: 0; }
}
.g-counter {
  position: absolute; z-index: 11; top: calc(env(safe-area-inset-top) + 16px); right: 12px;
  pointer-events: none;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  padding: 3px 7px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.g-toast {
  position: absolute; z-index: 6; left: 50%; top: calc(var(--g-top-h) + 12px);
  transform: translateX(-50%);
  padding: 9px 16px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.94); color: #111; font-size: 14px; font-weight: 600;
  white-space: nowrap; pointer-events: none;
  animation: g-toast 2200ms var(--ease-out) forwards;
}
@keyframes g-toast {
  0% { opacity: 0; transform: translate(-50%, -8px); }
  10%, 85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -4px); }
}
.g-reel-error { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--g-muted); }

/* ---------- end card ---------- */
.g-end .g-frame {
  display: grid; place-items: center; text-align: center;
  padding: var(--g-top-h) var(--gutter) env(safe-area-inset-bottom);
  background: radial-gradient(80% 50% at 50% 40%, rgba(238, 42, 123, 0.28), transparent 70%), #0b0b0f;
}
.g-end-in { display: flex; flex-direction: column; align-items: center; }
.g-end-heart { font-size: 64px; line-height: 1; }
.g-end.is-current .g-end-heart { animation: g-beat 1.2s ease-in-out infinite; }
@keyframes g-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(0.98); } 45% { transform: scale(1.1); } }
.g-end-title { margin: 18px 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.g-end-sub { margin: 0; color: var(--g-muted); font-size: 15px; }
.g-replay {
  margin-top: 22px; border: 0; padding: 10px 18px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12); color: var(--g-text); font-weight: 600; font-size: 14px;
}
.g-end .btn-back-wrap { padding-top: 14px; }
.g-end .btn {
  background: var(--g-gradient); color: #fff; border: 0; font-weight: 700;
  box-shadow: 0 8px 24px rgba(238, 42, 123, 0.35);
}

/* ---------- tappable stats + highlights ---------- */
.g-stat--btn {
  padding: 4px 0; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 160ms, transform 160ms var(--ease-out);
}
.g-stat--btn:active { transform: scale(0.95); background: rgba(255, 255, 255, 0.06); }
.g-hl-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%;
  padding: 0; border: 0; background: none; color: inherit; font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.g-hl-btn .g-hl-ring { transition: transform 160ms var(--ease-out); }
.g-hl-btn:active .g-hl-ring { transform: scale(0.92); }

.g-avatar-md { width: 54px; height: 54px; padding: 2px; }
.g-avatar-md .g-avatar-in { border-width: 2px; }
.g-avatar-md .g-avatar-initial { font-size: 20px; }
.g-avatar.is-popped { animation: g-pop 460ms var(--ease-spring); }

/* ---------- followers / following bottom sheet ---------- */
.g-sheet-layer { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.g-sheet-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6);
  opacity: 0; transition: opacity 260ms var(--ease-out);
}
.g-sheet {
  --g-drag: 0px;
  position: relative; z-index: 1;
  width: var(--g-frame-w); max-height: 82dvh; min-height: 46dvh; overflow-y: auto;
  padding: 0 0 calc(20px + env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  background: #262629; color: var(--g-text);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
  transform: translateY(calc(100% + 20px));
  transition: transform 300ms var(--ease-out);
  outline: none; overscroll-behavior: contain;
}
.g-sheet-layer.is-open .g-sheet-backdrop { opacity: 1; }
.g-sheet-layer.is-open .g-sheet { transform: translateY(var(--g-drag)); }
.g-sheet.is-dragging { transition: none; }
.g-sheet-grip {
  position: sticky; top: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 56px 12px; background: #262629;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  touch-action: none; cursor: grab;
}
.g-sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.35); }
.g-sheet-title { margin: 12px 0 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.g-sheet-x { position: absolute; top: 14px; right: 6px; z-index: 2; width: 40px; height: 40px; }
.g-sheet-x .g-ico { width: 22px; height: 22px; filter: none; }
.g-sheet-search {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 16px 6px; padding: 0 12px; height: 38px; border-radius: 10px;
  background: #3a3a3f; color: rgba(255, 255, 255, 0.55); font-size: 15px;
}
.g-sheet-search .g-ico { width: 17px; height: 17px; fill: none; filter: none; }
.g-sheet-list { padding: 4px 0 0; }
.g-sheet-row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.g-sheet-who {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.g-sheet-who .g-avatar-in { border-color: #262629; }
.g-sheet-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.g-sheet-names > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-sheet-handle-name { font-size: 14px; font-weight: 700; }
.g-sheet-realname { font-size: 14px; color: var(--g-muted); }
.g-sheet-actwrap { position: relative; flex: none; }
.g-sheet-follow {
  min-height: 32px; padding: 0 16px; border: 0; border-radius: 8px;
  background: #3a3a3f; color: #fff; font-size: 14px; font-weight: 600;
  transition: background 160ms, transform 160ms var(--ease-out);
}
.g-sheet-follow.is-primary { background: #0095f6; }
.g-sheet-follow:active { transform: scale(0.95); }
.g-sheet-note {
  margin: 0 16px 0 82px; font-size: 13px; line-height: 1.35; color: var(--g-muted);
}
.g-sheet-end { margin: 26px 16px 0; text-align: center; font-size: 12px; color: rgba(255, 255, 255, 0.4); }
.g-sheet-layer .g-toast { z-index: 3; }

/* ---------- highlight story viewer ---------- */
.g-story { position: fixed; inset: 0; z-index: 30; display: flex; justify-content: center; background: #000; }
.g-story.is-open { animation: g-story-in 280ms var(--ease-out) both; }
@keyframes g-story-in { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
.g-story-frame {
  position: relative; width: var(--g-frame-w); height: 100dvh; overflow: hidden;
  background: linear-gradient(160deg, #f9ce34 0%, #ee2a7b 55%, #6228d7 100%);
  transition: background 400ms;
}
.g-story-frame[data-bg="1"] { background: linear-gradient(165deg, #4facfe 0%, #6a5af9 55%, #c850c0 100%); }
.g-story-frame[data-bg="2"] { background: linear-gradient(160deg, #ffb347 0%, #ff6a5c 50%, #c3245a 100%); }
.g-story-frame[data-bg="3"] { background: linear-gradient(165deg, #ff9ac8 0%, #e2457f 50%, #7b2ff7 100%); }
.g-story-frame::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 45% at 50% 42%, rgba(255, 255, 255, 0.28), transparent 70%);
}
.g-story-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.g-story-frame.has-img .g-story-img { display: block; }
.g-story-frame.has-img::before { display: none; }
.g-story-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 18%, transparent 60%, rgba(0, 0, 0, 0.25));
}
.g-story-frame.has-img .g-story-shade { background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 22%, transparent 45%, rgba(0, 0, 0, 0.65)); }
.g-story-bars {
  position: absolute; z-index: 3; top: calc(env(safe-area-inset-top) + 8px); left: 8px; right: 8px;
  display: flex; gap: 3px; pointer-events: none;
}
.g-story-bar { flex: 1; height: 2.5px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, 0.35); }
.g-story-fill {
  display: block; height: 100%; background: #fff;
  transform: scaleX(var(--p, 0)); transform-origin: left center;
}
.g-story-head {
  position: absolute; z-index: 4; top: calc(env(safe-area-inset-top) + 18px); left: 10px; right: 2px;
  display: flex; align-items: center; gap: 8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.g-story-av { width: 32px; height: 32px; padding: 0; background: none; }
.g-story-av .g-avatar-in { border: 0; }
.g-story-label { font-size: 14px; font-weight: 700; }
.g-story-who { flex: 1; min-width: 0; font-size: 13px; color: rgba(255, 255, 255, 0.75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-story-x .g-ico { width: 24px; height: 24px; }
.g-story-body {
  position: absolute; z-index: 1; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 90px 28px 110px; text-align: center; pointer-events: none;
}
.g-story-emoji { font-size: 120px; line-height: 1; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.25)); }
.g-story-frame.has-img .g-story-emoji { display: none; }
.g-story-text {
  margin: 30px 0 0; max-width: 18ch;
  font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); text-wrap: balance;
}
.g-story-frame.has-img .g-story-body { justify-content: flex-end; }
.g-story-body.is-in .g-story-emoji { animation: g-story-pop 520ms var(--ease-spring) both; }
.g-story-body.is-in .g-story-text { animation: fade-up 480ms var(--ease-out) 120ms both; }
@keyframes g-story-pop { from { opacity: 0; transform: scale(0.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
.g-story-zone {
  position: absolute; z-index: 2; top: calc(env(safe-area-inset-top) + 64px); bottom: 0;
  padding: 0; border: 0; background: transparent; color: transparent;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none;
}
.g-story-prev { left: 0; width: 50%; }
.g-story-next { right: 0; width: 50%; }
.g-story-zone:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: -6px; }

@media (prefers-reduced-motion: reduce) {
  .g-tile { animation: none; }
  .g-sheet, .g-sheet-backdrop { transition: none; }
  .g-story.is-open, .g-story-body.is-in .g-story-emoji, .g-story-body.is-in .g-story-text, .g-avatar.is-popped { animation: none; }
}
