/* Piddlegram — a very serious social network for dogs.
   Dark first, iPhone-portrait first, safe-area aware, no horizontal overflow. */

:root {
  --bg: #0a0e0b;
  --surface: #121a14;
  --surface-2: #182219;
  --surface-3: #1f2b20;
  --line: #27362a;
  --line-soft: #1e2a20;
  --text: #eef4ee;
  --muted: #9bb0a0;
  --pee: #f7d03f;
  --pee-deep: #c9a413;
  --grass: #7fd47f;
  --poop: #b98055;
  --blue: #5aa9ff;
  --danger: #ff8a7a;
  --radius: 14px;
  --radius-lg: 20px;
  --tab-h: 58px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Author `display` rules beat the UA's `[hidden] { display: none }`, so say it here:
   every overlay in this app is hidden by attribute, and must actually disappear. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; user-select: none; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
em { font-style: normal; }

.app {
  display: flex;
  flex-direction: column;
  height: 100svh;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

/* ---------- app bar ---------- */
.appbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 14, 11, 0.94);
  backdrop-filter: blur(14px);
  z-index: 6;
}

.wordmark {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.wordmark-dot { color: var(--pee); }

.appbar-actions { display: flex; align-items: center; gap: 2px; }

.icon-btn {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: 0;
  border-radius: 12px;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  position: relative;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn.back { font-size: 26px; line-height: 1; color: var(--muted); }

.badge {
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--pee);
  color: #17200f;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.icon-btn .badge { position: absolute; top: 3px; right: 1px; }

/* ---------- views ---------- */
.views {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
}
.view { padding: 0 0 8px; }

.section { padding: 16px 14px 4px; }
.section-title {
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.section-title em { color: var(--pee); letter-spacing: 0.04em; text-transform: none; }

/* ---------- sniffories ---------- */
.sniffories {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: none;
}
.sniffories::-webkit-scrollbar { display: none; }

.sniffory {
  flex: 0 0 auto;
  width: 62px;
  background: none;
  border: 0;
  padding: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
}
.sniffory-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 2.5px;
  background: conic-gradient(from 210deg, var(--pee), var(--grass), var(--poop), var(--pee));
  display: grid;
  place-items: center;
}
.sniffory-ring.seen { background: var(--line); }
.sniffory-ring i {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--bg);
  display: grid;
  place-items: center;
  font-size: 25px;
  background: var(--surface-2);
}
.sniffory-name {
  font-size: 10.5px;
  color: var(--muted);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- feed modes ---------- */
.mode-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 14px 10px;
  scrollbar-width: none;
}
.mode-row::-webkit-scrollbar { display: none; }

.mode {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.mode.is-on { background: var(--pee); border-color: var(--pee); color: #17200f; }

.algo-note {
  padding: 0 16px 8px;
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
}

/* ---------- post card ---------- */
.feed { display: grid; gap: 14px; padding: 0 10px; }

.card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.card.is-mine { border-color: rgba(247, 208, 63, 0.45); }

.card-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: linear-gradient(150deg, var(--from, #4a7fe0), var(--to, #1e3a8a));
  display: grid;
  place-items: center;
  font-size: 19px;
  padding: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar.big { width: 62px; height: 62px; font-size: 31px; }

.who { flex: 1 1 auto; min-width: 0; }
.name-row { display: flex; align-items: center; gap: 5px; }
.display-name {
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.verified {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue);
  color: #04121f;
  font-size: 9px;
  font-weight: 900;
  display: grid;
  place-items: center;
}
.card-meta {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.method-badge {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.method-badge.poop { color: var(--poop); border-color: rgba(185, 128, 85, 0.5); }

.art {
  position: relative;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1.5px 1.5px at 18% 26%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 72% 18%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(1.5px 1.5px at 40% 74%, rgba(255, 255, 255, 0.3), transparent 60%),
    radial-gradient(1.5px 1.5px at 84% 62%, rgba(255, 255, 255, 0.4), transparent 60%);
}
.art-glyph { font-size: 74px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45)); }

/* The fake photograph each dog took of the spot it marked. The procedural scent gradient
   underneath stays as the fallback while it loads, or if a post has no photo at all. */
.art-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.art-place, .art-tag { z-index: 2; }
.cell-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.art-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(4, 8, 5, 0.62);
  backdrop-filter: blur(6px);
  color: #f3f7f3;
}
.art-place { position: absolute; right: 10px; top: 10px; z-index: 2; font-size: 16px; }

.card-body { padding: 12px 12px 0; }

.locked-caption {
  filter: blur(7px);
  opacity: 0.55;
  user-select: none;
  pointer-events: none;
  overflow-wrap: anywhere;
}

.sniff-lock {
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 10px;
  background: var(--surface-2);
}
.sniff-lock p { font-size: 12.5px; color: var(--muted); }

.sniff-row { display: flex; align-items: center; gap: 10px; }

.sniff-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  min-height: 44px;
  border-radius: 999px;
  border: 0;
  background: var(--pee);
  color: #17200f;
  font-weight: 800;
  font-size: 14px;
  touch-action: none;
  -webkit-touch-callout: none;
}
.sniff-btn.is-sniffing { box-shadow: 0 0 0 4px rgba(247, 208, 63, 0.22); }
.sniff-btn .nose { font-size: 17px; }

.meter {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--grass), var(--pee));
}

.assist {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report {
  border: 1px solid var(--line);
  border-left: 3px solid var(--pee);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--surface-2);
  display: grid;
  gap: 9px;
  animation: unfurl 0.24s ease-out;
}
.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}
.report-head .noses { font-size: 12px; letter-spacing: -1px; }
.note-list { display: flex; flex-wrap: wrap; gap: 6px; }
.note {
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.note b { font-weight: 400; }
.report-verdict { font-size: 13.5px; font-weight: 600; }
.report-fine { font-size: 11.5px; color: var(--muted); }

.caption { margin-top: 12px; overflow-wrap: anywhere; }
.caption .handle { font-weight: 700; margin-right: 5px; }
.tags { margin-top: 6px; font-size: 12.5px; color: var(--blue); overflow-wrap: anywhere; }

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 12px;
}
.act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  background: none;
  border-radius: 12px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}
.act:active { background: var(--surface-2); }
.act.is-on { color: var(--pee); }
.act.is-buried { color: var(--grass); }
.act .count { color: var(--muted); font-weight: 500; }
.act.is-on .count { color: var(--pee); }
.act.spacer { margin-left: auto; }

.paw-pop {
  position: absolute;
  pointer-events: none;
  font-size: 20px;
  animation: pawRise 0.7s ease-out forwards;
}

.replies { padding: 0 12px 12px; display: grid; gap: 8px; }
.reply { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.reply .avatar { width: 26px; height: 26px; font-size: 13px; border-width: 1px; }
.reply-text { color: var(--text); overflow-wrap: anywhere; }
.reply-text b { color: var(--muted); font-weight: 600; }
.reply-more { font-size: 12px; color: var(--muted); background: none; border: 0; padding: 0; text-align: left; }

.reply-form { display: flex; gap: 8px; padding: 0 12px 12px; }
.reply-form input {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
}
.reply-form button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--surface-3);
  font-weight: 700;
  font-size: 13px;
}

/* ---------- park ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 0 3px;
}
.grid-cell {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 26px;
}
.grid-cell .cell-tag {
  position: absolute;
  bottom: 4px;
  left: 4px;
  z-index: 2;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(4, 8, 5, 0.7);
}

.rank-list { display: grid; gap: 8px; }
.rank {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}
.rank .rank-no { font-size: 12px; color: var(--muted); width: 16px; }
.rank .rank-body { flex: 1 1 auto; min-width: 0; }
.rank strong { display: block; font-size: 14px; }
.rank small { color: var(--muted); font-size: 11.5px; }
.rank .rank-count { font-size: 12px; color: var(--pee); font-weight: 700; }

.pack-list { display: grid; gap: 8px; }
.pack-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; }
.pack-row .who { flex: 1 1 auto; min-width: 0; }
.pack-row small { color: var(--muted); font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.follow-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--pee);
  color: #17200f;
  font-weight: 700;
  font-size: 13px;
}
.follow-btn.is-following { background: var(--surface-3); color: var(--muted); }

/* ---------- barks ---------- */
.bark-list { display: grid; }
.bark {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.bark.is-new { background: rgba(247, 208, 63, 0.05); }
.bark-icon { font-size: 20px; width: 26px; text-align: center; flex: 0 0 auto; }
.bark-text { flex: 1 1 auto; min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.bark-text b { font-weight: 700; }
.bark-age { font-size: 11px; color: var(--muted); flex: 0 0 auto; }

/* ---------- profile ---------- */
.profile-head { padding: 18px 14px 0; display: grid; gap: 12px; }
.profile-top { display: flex; align-items: center; gap: 14px; }
.profile-id { min-width: 0; }
.profile-id h1 { font-size: 20px; letter-spacing: -0.01em; }
.profile-id small { color: var(--muted); font-size: 12.5px; display: block; }
.profile-bio { font-size: 13.5px; color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.stat {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 9px 4px;
  background: var(--surface);
}
.stat strong { display: block; font-size: 16px; }
.stat small { font-size: 10.5px; color: var(--muted); }

.profile-actions { display: flex; gap: 8px; }
.ghost-btn {
  flex: 1 1 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 11px 12px;
  font-weight: 600;
  font-size: 13.5px;
}

.insights {
  margin: 16px 14px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
  display: grid;
  gap: 8px;
}
.insights h2 { font-size: 13px; letter-spacing: 0.02em; }
.insight { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.insight span:last-child { color: var(--pee); font-weight: 700; white-space: nowrap; }
.insight-quip { font-size: 12px; color: var(--muted); font-style: italic; }

.empty {
  margin: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: var(--surface);
}

.share-row { display: flex; gap: 8px; margin: 14px 14px 0; }
.share-row code {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 11.5px;
  color: var(--muted);
}

.app-foot { padding: 20px 16px calc(28px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 11.5px; }

/* ---------- tab bar ---------- */
.tabbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  border-top: 1px solid var(--line-soft);
  background: rgba(13, 18, 14, 0.97);
  backdrop-filter: blur(14px);
  padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
  z-index: 6;
}
.tab {
  border: 0;
  background: none;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 12px;
  color: var(--muted);
  position: relative;
  min-height: var(--tab-h);
}
.tab.is-active { color: var(--text); }
.tab-icon { font-size: 19px; line-height: 1.1; filter: grayscale(1) opacity(0.65); }
.tab.is-active .tab-icon { filter: none; }
/* the profile tab holds the dog's own portrait rather than an emoji */
.tab-icon img { width: 22px; height: 22px; object-fit: cover; border-radius: 50%; display: block; }
.tab-icon.has-photo { filter: opacity(0.75); }
.tab.is-active .tab-icon.has-photo { filter: none; }
.tab-label { font-size: 9.5px; font-weight: 600; letter-spacing: 0.01em; }
.tab-badge { position: absolute; top: 4px; right: 18%; }

.compose-fab {
  border: 0;
  border-radius: 16px;
  width: 52px;
  height: 52px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  font-size: 23px;
  background: linear-gradient(150deg, var(--pee), var(--pee-deep));
  box-shadow: 0 6px 18px rgba(247, 208, 63, 0.22);
}

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(2, 5, 3, 0.66); backdrop-filter: blur(3px); }
.sheet-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 90svh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  animation: rise 0.22s ease-out;
  overflow: hidden;
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 10px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.sheet-head h2 { flex: 1 1 auto; font-size: 16px; }
.sheet-body { padding: 14px 16px 4px; overflow-y: auto; display: grid; gap: 16px; }
.sheet-foot { padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); }

.field { display: grid; gap: 8px; }
.field-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field-label em { color: var(--pee); text-transform: none; letter-spacing: 0.02em; }
.field-hint { font-size: 11.5px; color: var(--muted); }

textarea, input[type="text"] {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  resize: none;
}
textarea:focus, input:focus { outline: 2px solid var(--pee); outline-offset: 1px; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}
.seg.is-on { border-color: var(--pee); background: rgba(247, 208, 63, 0.12); color: var(--pee); }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-row.filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-row.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text);
}
.chip.is-on { border-color: var(--pee); background: rgba(247, 208, 63, 0.14); color: var(--pee); font-weight: 600; }
.filters .chip { display: inline-flex; align-items: center; gap: 6px; }

.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--line);
  padding: 0;
}
.swatch.is-on { border-color: var(--pee); box-shadow: 0 0 0 3px rgba(247, 208, 63, 0.2); }

.primary {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background: linear-gradient(150deg, var(--pee), var(--pee-deep));
  color: #17200f;
  font-weight: 800;
  font-size: 15px;
  width: 100%;
}
.primary:disabled { opacity: 0.5; }
.primary.wide { margin-top: 4px; }

.error { color: var(--danger); font-size: 12.5px; }

/* ---------- sniffories viewer ---------- */
.story { position: fixed; inset: 0; z-index: 40; background: rgba(3, 6, 4, 0.96); display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 12px) 12px calc(env(safe-area-inset-bottom) + 16px); }
.story-bars { display: flex; gap: 4px; padding: 0 2px 12px; }
.story-bars i { flex: 1 1 auto; height: 3px; border-radius: 2px; background: var(--surface-3); }
.story-bars i.on { background: var(--pee); }
.story-card {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 22px 18px;
  position: relative;
  overflow: hidden;
}
.story-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 8, 5, 0.1), rgba(4, 8, 5, 0.86));
}
.story-card > * { position: relative; z-index: 2; }
.story-head { display: flex; align-items: center; gap: 10px; }
.story-glyph { font-size: 60px; }
.story-text { font-size: 16.5px; font-weight: 600; overflow-wrap: anywhere; }
.story-hint { font-size: 12px; color: #dfe8e0; }
.story-close { position: absolute; top: calc(env(safe-area-inset-top) + 8px); right: 12px; z-index: 3; }

/* ---------- onboarding ---------- */
.onboarding { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; }
.onboard-panel {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 26px) 18px calc(env(safe-area-inset-bottom) + 30px);
  display: grid;
  gap: 16px;
}
.onboard-eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pee); }
.onboard-panel h1 { font-size: 30px; letter-spacing: -0.02em; line-height: 1.1; }
.onboard-blurb { font-size: 13.5px; color: var(--muted); }
.onboard-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 14px;
}
.onboard-preview strong { display: block; font-size: 16px; }
.onboard-preview small { color: var(--muted); font-size: 12px; }
.onboard-foot { font-size: 11.5px; color: var(--muted); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 22px);
  transform: translateX(-50%);
  z-index: 60;
  margin: 0;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  max-width: min(90vw, 420px);
  text-align: center;
  animation: rise 0.2s ease-out;
}

/* ---------- motion ---------- */
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes unfurl { from { transform: translateY(-6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pawRise { from { transform: translateY(0) scale(0.7); opacity: 1; } to { transform: translateY(-52px) scale(1.25); opacity: 0; } }
@keyframes wag { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
.avatar.wagging { animation: wag 0.4s ease-in-out 2; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}

@media (min-width: 620px) {
  .feed { padding: 0 14px; }
  .views { padding-bottom: 28px; }
}
