/* Splatter on the web. Same tokens as the iPhone app (Theme.swift) and the brand
   guideline: warm near-black ground, paper text, one saffron accent. */
:root {
  /* colour */
  --ground: #0E1110;   /* Ink 900 */
  --panel: #181C1B;    /* Ink 800 */
  --raised: #222726;   /* Ink 700 */
  --line: rgba(255, 255, 255, 0.09);
  --text: #F2F0EA;     /* Paper */
  --muted: rgba(242, 240, 234, 0.58);
  --faint: rgba(242, 240, 234, 0.38);
  --accent: #F4A62A;   /* Saffron */
  --on-accent: #0E1110;
  --coral: #FF6B5E;
  --danger: var(--coral);
  --link: #8FB5FF;     /* Sky */
  --mint: #5FD3A0;
  --gradient: linear-gradient(135deg, var(--accent), var(--coral));
  /* radius */
  --r-small: 10px; --r-control: 14px; --r-card: 18px; --r-panel: 24px; --r-bar: 28px;
  /* space */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  /* motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --nav-text: rgba(242, 240, 234, 0.76);
  --topbar: rgba(14, 17, 16, 0.94);
  --hover: rgba(255, 255, 255, 0.07);
  --side: 236px;
  color-scheme: dark;
}
/* Light appearance: chosen in the ⋯ menu on your profile, or "System" with a light device. */
:root[data-theme="light"] {
  --ground: #F6F4EF; --panel: #FFFFFF; --raised: #ECE9E2;
  --line: rgba(14, 17, 16, 0.10);
  --text: #141716; --muted: rgba(20, 23, 22, 0.60); --faint: rgba(20, 23, 22, 0.40);
  --coral: #E5483B; --link: #2F6FE0; --mint: #1E9E6A;
  --nav-text: rgba(20, 23, 22, 0.72); --topbar: rgba(246, 244, 239, 0.94); --hover: rgba(14, 17, 16, 0.05);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --ground: #F6F4EF; --panel: #FFFFFF; --raised: #ECE9E2;
    --line: rgba(14, 17, 16, 0.10);
    --text: #141716; --muted: rgba(20, 23, 22, 0.60); --faint: rgba(20, 23, 22, 0.40);
    --coral: #E5483B; --link: #2F6FE0; --mint: #1E9E6A;
    --nav-text: rgba(20, 23, 22, 0.72); --topbar: rgba(246, 244, 239, 0.94); --hover: rgba(14, 17, 16, 0.05);
    color-scheme: light;
  }
}
/* Videos, scenes and stories always stay dark. */
body.immersive, .scene, .story-viewer {
  --ground: #0E1110; --panel: #181C1B; --raised: #222726; --line: rgba(255, 255, 255, 0.09);
  --text: #F2F0EA; --muted: rgba(242, 240, 234, 0.58); --faint: rgba(242, 240, 234, 0.38);
  --coral: #FF6B5E; --link: #8FB5FF; --mint: #5FD3A0;
  --nav-text: rgba(242, 240, 234, 0.76); --topbar: rgba(14, 17, 16, 0.94); --hover: rgba(255, 255, 255, 0.07);
  color-scheme: dark; color: var(--text);
}
body.immersive { background: #000; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ground);
  color: var(--text);
  font: 15px/1.45 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video, canvas { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.icon { display: inline-flex; }
.muted { color: var(--muted); }
.center { text-align: center; }
.fine { color: var(--muted); font-size: 12.5px; }
.error { color: var(--danger); font-size: 13.5px; min-height: 0; }
.error:empty, .notice:empty { display: none; }
.notice { color: var(--accent); font-size: 13.5px; }
.grow { flex: 1; }

/* ---------- frame: sidebar on wide screens, bars top and bottom on phones */
#side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); padding: 22px 14px;
  display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line);
}
#top, #bar { display: none; }
#view { margin-left: var(--side); min-height: 100vh; padding: 26px 20px 60px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--accent); padding: 4px 12px 18px; }
.brand span:last-child { color: var(--text); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.nav {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 16px;
  color: var(--nav-text); font-size: 16px;
}
.nav:hover { background: var(--panel); }
.nav.on { color: var(--accent); font-weight: 700; }
.nav.make .plus {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; background: var(--accent); color: var(--ground);
}
.dot { position: absolute; left: 30px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.join { margin-top: 14px; }

@media (max-width: 820px) {
  #side { display: none; }
  #view { margin-left: 0; padding: 66px 0 104px; }
  #top {
    display: flex; position: fixed; inset: 0 0 auto 0; z-index: 5; height: 54px; align-items: center; justify-content: space-between;
    padding: 0 14px; background: var(--topbar); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  #top .brand { padding: 0; }
  #top .brand span:last-child { font-size: 19px; }
  #top .nav { padding: 8px; }
  #top .dot { left: 26px; top: 6px; }
  #bar {
    display: flex; position: fixed; z-index: 5; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom));
    height: 70px; padding: 0 6px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 28px;
  }
  #bar .nav { flex: 1; flex-direction: column; gap: 3px; padding: 6px 0; font-size: 10.5px; }
  #bar .nav:hover { background: none; }
  #bar .nav.make .plus { width: 50px; height: 50px; border-radius: 19px; }
  #bar .nav.make .nav-label { display: none; }
}
body.immersive #view { padding: 0; }
body.immersive #top { display: none; }

/* ---------- shared pieces */
.column { width: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.column.wide { max-width: 900px; }
@media (max-width: 820px) { .column > :not(.feed):not(.grid):not(.card) { margin-left: 14px; margin-right: 14px; } }
.title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.section { font-size: 16px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 14px; font-weight: 700; font-size: 16px; text-align: center;
}
.button.small { min-height: 38px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.button.primary { background: var(--accent); color: var(--on-accent); }
.button.quiet { background: var(--panel); border: 1px solid var(--line); }
.button.danger { background: rgba(255, 107, 94, 0.14); color: var(--danger); }
.button:disabled { opacity: 0.45; cursor: default; }
.link { color: var(--accent); font-weight: 600; font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input[type="text"], input[type="url"], input[type="email"], input[type="password"], input[type="search"], textarea {
  width: 100%; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font: inherit; font-size: 16px; resize: vertical;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
.column > input, .column > .search { width: auto; align-self: stretch; }
.segments { display: flex; padding: 4px; background: var(--panel); border-radius: 14px; border: 1px solid var(--line); }
.segments button { flex: 1; min-height: 36px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.segments button.on { background: var(--accent); color: var(--on-accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.label { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 11.5px; }
.panel { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); }
.avatar {
  display: grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; background: var(--panel);
  border: 1px solid var(--line); color: var(--muted);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 70px 30px 20px; text-align: center; grid-column: 1 / -1; }
.empty p { color: var(--muted); max-width: 320px; }
.empty-arch, .auth-arch { color: var(--accent); }
.spinner {
  width: 28px; height: 28px; margin: 40px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; grid-column: 1 / -1;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sentinel { grid-column: 1 / -1; min-height: 1px; }
#toast {
  position: fixed; left: 50%; bottom: 110px; z-index: 40; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 999px; background: var(--text); color: var(--on-accent); font-weight: 600; transition: 0.2s; max-width: 90vw;
}
#toast.shown { opacity: 1; transform: translate(-50%, 0); }

/* ---------- post card */
.feed { display: flex; flex-direction: column; gap: 30px; }
.card { display: flex; flex-direction: column; gap: 10px; }
.card header { display: flex; align-items: center; justify-content: space-between; padding: 0 2px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who small, .comment small { color: var(--muted); font-size: 12.5px; }
.more { width: 44px; height: 38px; display: grid; place-items: center; border-radius: 12px; }
.media { position: relative; overflow: hidden; background: #000; border-radius: var(--r-card); width: 100%; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.step {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 14.5px;
}
.media .step-row { position: absolute; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 8px; }
.step-row { display: flex; align-items: center; gap: 8px; }
.mark-chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 999px; background: rgba(14, 17, 16, 0.55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.mark-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.sound { position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, 0.55); }
.burst { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); opacity: 0; pointer-events: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)); }
.burst.go { animation: burst 0.8s ease-out; }
@keyframes burst { 0% { opacity: 0; transform: scale(0.5); } 25% { opacity: 1; transform: scale(1.1); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
.actions { display: flex; align-items: center; gap: 18px; padding: 0 4px; }
.actions button, .actions a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; }
.actions .on { color: var(--accent); }
.actions .count-only { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; }
.actions b { font-variant-numeric: tabular-nums; font-weight: 600; }
.views { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.caption { padding: 0 4px; overflow-wrap: anywhere; }
@media (max-width: 820px) { .card header, .actions, .caption { padding-left: 14px; padding-right: 14px; } .media { border-radius: 0; } }

/* ---------- grids, people, comments, activity */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
@media (min-width: 821px) { .grid { gap: 8px; } .tile { border-radius: var(--r-small); } }
.tile { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--panel); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7)); }
.search { border-radius: 999px !important; }
.people { display: flex; flex-direction: column; }
.person { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-radius: 14px; }
.person:hover { background: var(--panel); }
.person > span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.person small { color: var(--muted); }
.comments { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment p { overflow-wrap: anywhere; }
.comment small { display: flex; gap: 12px; align-items: center; }
.comment .link { font-size: 12.5px; }
.comment-form { display: flex; gap: 8px; position: sticky; bottom: 96px; background: var(--ground); padding: 8px 0; }
@media (min-width: 821px) { .comment-form { bottom: 0; } }
.comment-form input { border-radius: 999px; }
.activity { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.activity .who > span { white-space: normal; display: flex; flex-direction: column; gap: 4px; }
.activity { padding: 10px 14px; margin: 0 -14px; border-radius: var(--r-control); }
.activity.fresh { background: color-mix(in srgb, var(--tone) 8%, transparent); }
.activity .when { color: var(--muted); font-size: 13px; }
.activity-group { display: flex; flex-direction: column; gap: 2px; }
.activity-group h3 { font-size: 15px; font-weight: 700; margin: 14px 0 4px; }
.kind-wrap { position: relative; flex: none; display: inline-flex; }
.kind-badge { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--tone); color: var(--on-accent); box-shadow: 0 0 0 2.5px var(--ground); }
.kind-badge.k-coral { color: #fff; }
.kind-badge.k-text { color: var(--ground); }
.quote { quotes: none; display: block; padding-left: 9px; border-left: 2.5px solid var(--tone); color: var(--muted); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.k-coral { --tone: var(--coral); } .k-link { --tone: var(--link); } .k-mint { --tone: var(--mint); } .k-accent { --tone: var(--accent); } .k-text { --tone: var(--text); }
.thumb { flex: none; width: 48px; height: 48px; border-radius: var(--r-small); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- profile */
.profile { display: flex; gap: 26px; align-items: flex-start; padding: 6px 4px 10px; }
.profile > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.profile h1 { font-size: 22px; letter-spacing: -0.01em; }
.stats { display: flex; gap: 26px; }
.stats > * { display: flex; flex-direction: column; align-items: flex-start; color: var(--muted); font-size: 13px; line-height: 1.25; }
.stats b { color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.name { font-weight: 700; }
.bio { overflow-wrap: anywhere; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-actions .button { min-height: 40px; font-size: 14.5px; padding: 0 16px; }
@media (max-width: 520px) { .profile { gap: 16px; } .profile .avatar { width: 72px !important; height: 72px !important; } .stats { gap: 18px; } }

/* ---------- pop-ups */
.backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(3px); }
.sheet {
  width: 100%; max-width: 400px; max-height: 88vh; overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 22px;
  background: var(--ground); border: 1px solid var(--line); border-radius: 26px;
}
.sheet h2 { font-size: 20px; }
.auth { display: flex; flex-direction: column; gap: 10px; }
.auth form { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.auth small { color: var(--muted); font-size: 12px; margin-top: -4px; }
.auth h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
@media (max-width: 520px) { .backdrop { place-items: end center; padding: 0; } .sheet { border-radius: 26px 26px 0 0; max-width: none; padding-bottom: calc(22px + env(safe-area-inset-bottom)); } }

/* ---------- create */
.preview { border-radius: 20px; overflow: hidden; background: #000; display: grid; place-items: center; }
.preview canvas, .preview img, .preview video { max-height: 56vh; width: auto; max-width: 100%; height: auto; }

/* ---------- Splats */
.reel { height: 100vh; height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; background: #000; }
.reel::-webkit-scrollbar { display: none; }
.reel-page { position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; overflow: hidden; }
.reel-page video { height: 100%; width: 100%; max-width: calc(100dvh * 9 / 16); object-fit: cover; }
.reel-page video.whole { object-fit: contain; max-width: 100%; }
.shade { position: absolute; inset: 40% 0 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); pointer-events: none; }
.details, .side { position: absolute; bottom: 104px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.details { left: max(16px, calc(50% - 50dvh * 9 / 16 + 16px)); right: 90px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 420px; }
.details p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.details .step { text-shadow: none; }
.side { right: max(12px, calc(50% - 50dvh * 9 / 16 + 12px)); display: flex; flex-direction: column; gap: 18px; align-items: center; }
.side > * { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 58px; }
.side small { font-weight: 600; font-size: 12px; }
.side .on { color: var(--accent); }
.side .on small { color: #fff; }
@media (min-width: 821px) { .details, .side { bottom: 34px; } }
.reel .empty { height: 100dvh; justify-content: center; padding-top: 0; }

/* ---------- inside a scene */
.scene { position: fixed; inset: 0; z-index: 20; background: var(--ground); }
.scene-canvas { width: 100%; height: 100%; touch-action: none; cursor: grab; }
.scene-canvas:active { cursor: grabbing; }
.scene-status { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px; text-align: center; background: var(--ground); }
.bar { width: 200px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 4%; background: var(--accent); border-radius: 3px; transition: width 0.2s; }
.scene-hint {
  position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 9px 16px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px); font-size: 13.5px; text-align: center; max-width: 92vw; transition: opacity 0.4s; pointer-events: none;
}
.scene-hint.gone { opacity: 0; }
.round { position: absolute; top: calc(16px + env(safe-area-inset-top)); min-width: 44px; height: 44px; padding: 0 14px; display: grid; place-items: center; border-radius: 999px; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px); font-weight: 600; }
.round.close { left: 16px; padding: 0; width: 44px; }
.round.reset { right: 16px; }

@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ---------- our own right-click menu, and pictures that cannot be dragged or long-pressed away */
.menu {
  position: fixed; z-index: 50; min-width: 190px; padding: 6px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.menu > * { display: block; text-align: left; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 600; }
.menu > *:hover, .menu > *:focus-visible { background: var(--hover); }
img, video { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
video::-internal-media-controls-download-button { display: none; }

/* ---------- the owner's dashboard */
.admin .segments { max-width: 520px; }
.admin-body { display: flex; flex-direction: column; gap: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat b { font-size: 28px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12.5px; }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.chart-card { margin: 0; padding: 14px 16px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; gap: 8px; }
.chart-card figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chart-card figcaption span { color: var(--muted); font-size: 12.5px; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .column { fill: var(--accent); }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit:hover, .chart .hit:focus { fill: var(--hover); }
.chart-tip {
  position: absolute; transform: translate(-50%, calc(-100% - 8px)); padding: 5px 9px; border-radius: 8px; background: var(--text); color: var(--on-accent);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.12s;
}
.chart-tip.shown { opacity: 1; }
.chart-table summary { color: var(--muted); font-size: 12.5px; cursor: pointer; }
.chart-table table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.chart-table td { padding: 3px 0; border-bottom: 1px solid var(--line); }
.chart-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.admin-row .thumb { width: 64px; height: 64px; border-radius: 12px; }
.admin-row .thumb.blank { display: grid; place-items: center; background: var(--ground); color: var(--muted); }
.admin-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.admin-main small { color: var(--muted); }
.admin-main .quote { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.admin-actions .chip { min-height: 32px; font-size: 13px; padding: 0 12px; }
.pill { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: rgba(244, 166, 42, 0.16); color: var(--accent); font-size: 11.5px; font-weight: 700; vertical-align: 1px; }

.legal-links { margin-top: auto; padding: 0 12px; font-size: 12.5px; color: var(--muted); }
.legal-links a:hover { color: var(--text); }

/* ---------- reposts, stories, messages */
.count {
  position: absolute; left: 24px; top: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-style: normal; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
#top .count { left: 22px; top: 1px; }
.top-icons { display: flex; align-items: center; gap: 2px; }
.reposted { display: flex; align-items: center; gap: 6px; padding: 0 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
@media (max-width: 820px) { .reposted { padding: 0 14px; } }

.profile-tabs { display: flex; border-top: 1px solid var(--line); }
.profile-tabs button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px;
  color: var(--muted); font-weight: 700; font-size: 13.5px; border-top: 2px solid transparent; margin-top: -1px;
}
.profile-tabs button.on { color: var(--text); border-top-color: var(--text); }
@media (max-width: 520px) { .profile-tabs .tab-label { display: none; } }

.stories { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story-bubble { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 74px; flex: none; }
.story-bubble small { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.story-face { position: relative; display: inline-grid; place-items: center; padding: 4px; border-radius: 50%; }
.story-face.ring { background: conic-gradient(from 200deg, #F4A62A, #FF6B5E, #F4A62A); }
.story-face.ring.seen { background: var(--line); }
.story-face.ring .avatar { box-shadow: 0 0 0 2.5px var(--ground); }
.story-add {
  position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 3px var(--ground);
}
button.story-face { cursor: default; }
button.story-face.ring { cursor: pointer; }

.story-viewer { position: fixed; inset: 0; z-index: 40; background: #000; display: grid; place-items: center; }
.story-stage { position: relative; width: 100%; height: 100%; max-width: calc(100dvh * 9 / 16); display: grid; place-items: center; overflow: hidden; background: #0b0b0b; }
@media (min-width: 821px) { .story-stage { height: calc(100dvh - 40px); border-radius: 18px; } }
.story-stage img, .story-stage video { width: 100%; height: 100%; object-fit: contain; }
.story-post { display: flex; flex-direction: column; gap: 10px; width: 78%; padding: 10px; border-radius: 20px; background: var(--panel); }
.story-post img { width: 100%; height: auto; max-height: 60dvh; object-fit: cover; border-radius: 12px; }
.story-post span { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.story-caption {
  position: absolute; left: 16px; right: 16px; bottom: 90px; text-align: center; font-size: 18px; font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); overflow-wrap: anywhere;
}
.story-bars, .story-head, .story-foot { position: absolute; left: 50%; transform: translateX(-50%); width: min(100%, calc(100dvh * 9 / 16)); z-index: 2; }
.story-bars { top: calc(10px + env(safe-area-inset-top)); display: flex; gap: 4px; padding: 0 10px; }
@media (min-width: 821px) { .story-bars { top: 30px; } .story-head { top: 42px !important; } .story-foot { bottom: 30px !important; } }
.story-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.story-bars i { display: block; height: 100%; background: #fff; }
.story-head { top: calc(22px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.story-head .who small { color: rgba(255, 255, 255, 0.75); }
.story-head .who { flex-direction: row; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.story-head .who > b { font-size: 14px; }
.story-foot { bottom: calc(14px + env(safe-area-inset-bottom)); padding: 0 12px; display: flex; justify-content: center; }
.story-tap { position: absolute; top: 90px; bottom: 90px; width: 35%; z-index: 1; }
.story-tap.left { left: 0; }
.story-tap.right { right: 0; width: 65%; }
.story-head .round, .story-reply .round, .chat-form .round, .chat-head .round { position: static; flex: none; }
.story-reply { display: flex; gap: 8px; width: 100%; }
.story-reply input { flex: 1; border-radius: 999px; background: rgba(0, 0, 0, 0.4); border-color: rgba(255, 255, 255, 0.4); }
.story-seen { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); font-weight: 700; font-size: 14px; }
.story-preview { max-width: 300px; margin: 0 auto; aspect-ratio: 9 / 16; display: grid; place-items: center; background: #000; border-radius: 18px; overflow: hidden; }
.story-preview img, .story-preview video { width: 100%; height: 100%; object-fit: contain; }
.panel.lit { border-color: var(--accent); }

.send-shortcuts { display: flex; gap: 8px; flex-wrap: wrap; }
.send-row { width: 100%; text-align: left; }
.send-row > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.send-row small { color: var(--muted); }
.send-row .state { padding: 6px 14px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 13px; }
.send-row.sent .state { background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.sheet .people { max-height: 46dvh; overflow-y: auto; }

.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inbox { display: flex; flex-direction: column; }
.chat-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 16px; }
.chat-row:hover { background: var(--panel); }
.chat-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.chat-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.unread .chat-text small { color: var(--text); font-weight: 700; }
.chat-row .dot { position: static; flex: none; }
.chat-head {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 8px 0; background: var(--ground);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 820px) { .chat-head { top: 54px; } body.chatting #bar { display: none; } body.chatting #view { padding-bottom: 20px; } }
.bubbles { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; min-height: 40vh; }
.bubble {
  align-self: flex-start; max-width: 78%; display: flex; flex-direction: column; gap: 6px; padding: 9px 13px;
  border-radius: 20px 20px 20px 6px; background: var(--panel); border: 1px solid var(--line); overflow-wrap: anywhere;
}
.bubble.mine { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-color: transparent; border-radius: 20px 20px 6px 20px; }
.bubble.mine .muted { color: rgba(0, 0, 0, 0.62); }
.shared-post { display: flex; flex-direction: column; gap: 6px; width: 220px; max-width: 100%; }
.shared-post img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; }
.shared-post span { display: flex; flex-direction: column; line-height: 1.3; }
.shared-post small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; opacity: 0.8; }
.story-thumb { width: 90px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; }
.chat-form { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: var(--ground); }
.chat-form input { flex: 1; border-radius: 999px; }
.chat-form .round { background: var(--accent); color: var(--on-accent); }

/* ---------- splashes, marks, ticks, insights */
.name-tag { display: inline-flex; align-items: center; gap: 4px; }
.tick { display: inline-flex; vertical-align: -3px; margin-left: 4px; }
.name-tag .tick { margin-left: 0; }
.profile h1 { display: flex; align-items: center; gap: 2px; }
.inline-link { color: #8FB4FF; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.splash-button.on b { color: var(--text); }
.splash-burst {
  position: absolute; z-index: 3; pointer-events: none; transform: translate(-50%, -50%) scale(0.2) rotate(-20deg);
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45)); animation: splash-in 1.05s cubic-bezier(.2, .9, .3, 1.2) forwards;
}
@keyframes splash-in {
  0% { transform: translate(-50%, -50%) scale(0.2) rotate(-20deg); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(1.12) rotate(4deg); opacity: 1; }
  32% { transform: translate(-50%, -50%) scale(0.96) rotate(0deg); opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.02); opacity: 0; }
}
.splash-map { position: absolute; inset: 0; z-index: 2; background: rgba(0, 0, 0, 0.35); }
.splash-map i {
  position: absolute; width: 18%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0%, color-mix(in srgb, var(--c) 45%, transparent) 35%, transparent 70%);
  mix-blend-mode: screen; opacity: 0.85;
}
.map-label {
  position: absolute; left: 12px; top: 12px; padding: 7px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.7);
  font-size: 13px; font-weight: 700;
}
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 2px solid transparent; }
.swatch.on { border-color: var(--text); background: var(--panel); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--muted); }
.compact-grid { grid-template-columns: repeat(2, 1fr) !important; }
.tile-stat {
  position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px;
  border-radius: 999px; background: rgba(0, 0, 0, 0.6); font-size: 12px; font-weight: 700;
}
.marks-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.scene-mark {
  position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: auto;
  display: grid; place-items: center; transform-origin: 13px 13px;
}
.scene-mark i {
  width: 14px; height: 14px; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent), 0 0 18px 6px color-mix(in srgb, var(--c) 60%, transparent);
  animation: mark-glow 2.4s ease-in-out infinite;
}
@keyframes mark-glow { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 20%, transparent), 0 0 26px 10px color-mix(in srgb, var(--c) 45%, transparent); } }
.mark-note {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); display: none; white-space: nowrap; max-width: 240px;
  overflow: hidden; text-overflow: ellipsis; padding: 6px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.78); font-size: 13px;
}
.scene-mark.open .mark-note, .scene-mark:hover .mark-note { display: block; }
.round.leave-mark { left: 50%; transform: translateX(-50%); gap: 8px; display: inline-flex; align-items: center; }

/* ---------- visitors (not signed in) */
body.visitor #bar { display: none; }
@media (max-width: 820px) { body.visitor #view { padding-bottom: 30px; } }
.welcome { gap: 22px; }
.welcome-hero {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 28px 24px;
  border-radius: 26px; background: radial-gradient(circle at 85% 10%, rgba(244, 166, 42, 0.22), transparent 55%), var(--panel);
  border: 1px solid var(--line);
}
.welcome-hero h1 { font-size: clamp(30px, 6vw, 46px); letter-spacing: -0.03em; line-height: 1.05; }
.welcome-hero p { max-width: 520px; font-size: 16px; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.welcome-actions .button { min-width: 150px; }
.tile-step {
  position: absolute; left: 6px; top: 6px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px;
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 800;
}
.panel.center { align-items: center; text-align: center; }

/* ---------- the row under a picture: every icon in the same box, numbers on the same line */
.actions { gap: 16px; min-height: 44px; }
.actions > button, .actions > a { display: inline-flex; align-items: center; gap: 5px; height: 40px; line-height: 1; }
.actions .icon, .actions > button > span:first-child, .actions > a > span:first-child { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; }
.actions svg { width: 26px; height: 26px; display: block; }
.actions b { font-size: 14px; font-weight: 700; line-height: 1; }
.actions .views { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1; }
.actions .views svg { width: 17px; height: 17px; }
.actions .grow { flex: 1; }

/* ---------- privacy */
.settings { gap: 0; padding: 4px 18px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.setting:last-child { border-bottom: 0; }
.setting > span { display: flex; flex-direction: column; gap: 3px; }
.setting small { color: var(--muted); font-size: 13px; }
.column-setting { flex-direction: column; align-items: flex-start; gap: 10px; cursor: default; }
.setting input[type="checkbox"] {
  appearance: none; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer;
  transition: background 0.15s;
}
.setting input[type="checkbox"]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.15s;
}
.setting input[type="checkbox"]:checked { background: var(--accent); }
.setting input[type="checkbox"]:checked::after { transform: translateX(20px); }
.private-note { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 50px 20px; text-align: center; }
.request-actions { display: flex; gap: 6px; flex: none; }
.actions .views .icon { width: 17px; height: 17px; }
.splash-burst .icon { position: relative; z-index: 1; }
.splash-burst .drop {
  position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: currentColor; opacity: 0; transform: translate(0, 0) scale(var(--s));
  animation: drop-fly 0.85s cubic-bezier(.15, .8, .3, 1) 0.04s forwards;
}
@keyframes drop-fly {
  0% { opacity: 0; transform: translate(0, 0) scale(var(--s)); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(calc(var(--s) * 0.4)); }
}
.send-shortcuts { gap: 6px; }
.share-target { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; font-size: 12px; font-weight: 600; color: var(--muted); }
.share-target > span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: var(--text); }

/* ---------- camera, music, places */
.media { border-radius: 16px; }
@media (max-width: 820px) { .feed .media, .card .media { border-radius: 14px; width: calc(100% - 16px); margin: 0 8px; } }
.who .when { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.who .song { display: inline-flex; align-items: center; gap: 4px; color: var(--text); opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.on-time { display: inline-flex; align-items: center; gap: 2px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 10.5px; padding: 1px 6px; border-radius: 999px; }
.story-head .who .song { color: #fff; }

/* ---------- selfie splashes */
.selfie-strip { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 0 4px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.selfie-strip .faces { display: inline-flex; }
.selfie-strip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ground, #0E1110); margin-left: -9px; }
.selfie-strip img:first-child { margin-left: 0; }
@media (max-width: 820px) { .selfie-strip { margin-left: 14px; } }
.selfie-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 14px 0; }
.selfie { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.selfie .face { position: relative; width: 88px; height: 88px; }
.selfie .face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.selfie .face i { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 24px; }
.selfie small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- feed tabs: words with an accent line under the chosen one */
.feed-tabs { display: flex; border-bottom: 1px solid var(--line); }
.feed-tabs button { flex: 1; position: relative; padding: 10px 0 12px; font-size: 15px; font-weight: 500; color: var(--muted); }
.feed-tabs button.on { color: var(--text); font-weight: 700; }
.feed-tabs button.on::after { content: ""; position: absolute; left: 50%; bottom: -1px; width: 28px; height: 3px; margin-left: -14px; border-radius: 3px; background: var(--accent); }

/* ---------- desktop right rail: suggestions and the small print */
.with-rail { display: flex; justify-content: center; gap: 56px; align-items: flex-start; }
.with-rail > .column { margin: 0; }
.rail { display: none; width: 300px; flex: none; position: sticky; top: 26px; flex-direction: column; gap: var(--s-3); padding-top: 4px; }
@media (min-width: 1160px) { .rail { display: flex; } }
.rail h3 { font-size: 14px; color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; }
.rail .person { padding: 6px 0; }
.rail .person:hover { background: none; }
.rail .suggest { display: flex; align-items: center; gap: var(--s-3); }
.rail .suggest .person { flex: 1; min-width: 0; }
.rail .suggest small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail .follow-link { color: var(--accent); font-weight: 700; font-size: 13.5px; }
.rail .fine { margin-top: var(--s-4); line-height: 1.7; }
.rail .fine a:hover { color: var(--text); }

/* ---------- profile: one row of actions, the rest behind a menu */
.profile-actions .icon-button { width: 40px; min-height: 40px; padding: 0; justify-content: center; }
@media (max-width: 520px) {
  .profile-actions { flex-wrap: nowrap; }
  .profile-actions .button:not(.icon-button) { flex: 1; padding: 0 10px; white-space: nowrap; }
}
.profile-link { display: inline-flex; align-items: center; gap: 5px; color: var(--link); font-weight: 600; max-width: 100%; }
.profile-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-link:hover span { text-decoration: underline; }

/* ---------- voice notes */
.voice-note { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.voice-play { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.bubble.mine .voice-play { background: rgba(14, 17, 16, 0.14); }
.voice-play.loading { opacity: 0.5; }
.wave { display: flex; align-items: center; gap: 2px; height: 24px; flex: 1; }
.wave i { width: 2.5px; border-radius: 2px; background: currentColor; opacity: 0.35; }
.wave i.on { opacity: 1; }
.voice-time { font-variant-numeric: tabular-nums; font-weight: 600; opacity: 0.75; }
.chat-form { position: sticky; }
.chat-form .mic { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.recording-bar { position: absolute; inset: 8px 0; display: flex; align-items: center; gap: 8px; background: var(--ground); }
.recording-bar .rec { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--panel); color: var(--muted); }
.recording-bar .rec b { color: var(--text); font-variant-numeric: tabular-nums; }
.recording-bar .rec i { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); animation: blink 1s infinite; }
.recording-bar .round.danger { color: var(--coral); background: var(--panel); }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- chat: photos, replies, reactions, seen */
.msg { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: 100%; }
.msg.mine { align-items: flex-end; }
.msg-line { display: flex; align-items: center; gap: 8px; max-width: 100%; }
.msg-line > .bubble { max-width: min(78vw, 420px); align-self: auto; }
.msg .forward { width: 34px; height: 34px; background: var(--panel); border: 1px solid var(--line); color: var(--text); position: static; flex: none; }
.reply-quote { display: flex; flex-direction: column; gap: 2px; max-width: 70%; }
.msg.mine .reply-quote { align-items: flex-end; }
.reply-quote small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.reply-quote span {
  font-size: 13.5px; color: var(--muted); padding: 7px 12px; border: 1px solid var(--line); border-radius: 14px; opacity: 0.85;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.reactions {
  margin-top: -10px; margin-inline: 8px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; font-size: 13px;
  background: var(--raised); border: 2px solid var(--ground); border-radius: 999px; position: relative; z-index: 1;
}
.reactions small { font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.bubble-media { display: flex; }
.chat-media {
  position: relative; display: block; width: 240px; max-width: 64vw; overflow: hidden; padding: 0; border-radius: 18px;
  border: 1px solid var(--line); background: var(--panel);
}
.chat-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-media .play {
  position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.45); color: #fff;
}
.chat-media-full { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 14px; background: #000; }
.chat-time { align-self: center; font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.chat-seen { align-self: flex-end; font-size: 11.5px; font-weight: 600; color: var(--muted); margin: 0 4px; }
.chat-bottom { position: sticky; bottom: 0; background: var(--ground); z-index: 2; }
.chat-bottom .chat-form { position: static; align-items: center; gap: 4px; padding: 6px 6px 6px 6px; margin: 8px 0 calc(10px + env(safe-area-inset-bottom));
  background: var(--panel); border: 1px solid var(--line); border-radius: 26px; }
.chat-bottom .chat-form input { background: transparent; border: 0; padding-left: 6px; min-width: 0; }
.chat-bottom .chat-form input:focus { outline: none; box-shadow: none; }
.chat-form .round.camera { width: 36px; height: 36px; background: var(--accent); color: var(--on-accent); }
.chat-form .round.plain, .chat-form .mic { background: transparent; border: 0; color: var(--text); }
.chat-extras { display: flex; align-items: center; }
.chat-extras[hidden] { display: none; }
.send-text { font-weight: 700; color: var(--accent); padding: 0 12px; height: 40px; }
.send-text[hidden] { display: none; }
.reply-bar { display: flex; align-items: center; gap: 10px; padding: 8px 4px 0 12px; border-left: 3px solid var(--accent); margin-top: 8px; }
.reply-bar[hidden] { display: none; }
.reply-bar span { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.reply-bar small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar .round { position: static; width: 32px; height: 32px; background: transparent; }
.chat-sending { text-align: right; font-size: 12.5px; color: var(--muted); margin: 6px 4px 0; }
.chat-sending[hidden] { display: none; }
.menu-emojis { display: flex; gap: 2px; padding: 4px !important; }
.menu-emojis button { font-size: 22px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.menu-emojis button:hover, .menu-emojis button.on { background: var(--hover); }

/* ---------- suggested posts */
.follow-chip {
  margin-left: auto; height: 32px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); flex: none;
}
.follow-chip[data-state] { color: var(--muted); }
.card header .follow-chip + .more { margin-left: 4px; }

/* ---------- the ☰ menu: a dropdown like Instagram's "More" */
.more-nav { margin-top: auto; width: 100%; text-align: left; }
.more-nav + .legal-links { margin-top: 8px; }
.menu-button { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--text); }
.menu-button:hover, .menu-button[aria-expanded="true"] { background: var(--hover); }
.dropdown {
  position: fixed; z-index: 60; width: 270px; max-height: calc(100vh - 16px); overflow-y: auto; padding: 8px;
  display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); animation: drop-in 0.14s var(--ease);
}
@keyframes drop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.dropdown > a, .dropdown > button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; text-align: left;
  font-size: 15px; color: var(--text);
}
.dropdown > a:hover, .dropdown > button:hover, .dropdown > a:focus-visible, .dropdown > button:focus-visible { background: var(--hover); outline: none; }
.dropdown .danger { color: var(--danger); }
.dropdown-line { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---------- profile, laid out like Instagram */
.profile-page { width: 100%; max-width: 1480px; margin: 0 auto; display: flex; flex-direction: column; }
.phead {
  width: 100%; max-width: 860px; margin: 8px auto 22px; display: grid; grid-template-columns: 290px 1fr; column-gap: 8px; row-gap: 18px;
  align-items: center;
}
.phead-face { grid-row: 1; display: flex; justify-content: center; }
.phead-info { grid-row: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.phead > .profile-actions { grid-column: 1 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.phead > .profile-actions .icon-button { grid-auto-columns: auto; }
.phead-row { display: flex; align-items: center; gap: 8px; }
.phead-row h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.phead-menu { margin-left: 4px; }
.pname { font-weight: 600; font-size: 15px; }
.pstats { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; font-size: 16px; color: var(--muted); }
.pstats b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.pstats button:hover b { text-decoration: underline; }
.phead .bio { white-space: pre-line; font-size: 15px; }
.plock { display: inline-flex; align-items: center; gap: 6px; }
.phead .profile-actions .button { min-height: 40px; font-size: 14.5px; padding: 0 16px; }
.phead .story-face .avatar { transition: transform 0.2s var(--ease); }

.ptabs { display: flex; justify-content: center; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.ptabs button {
  flex: 0 1 180px; display: flex; align-items: center; justify-content: center; gap: 8px; height: 54px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.ptabs button:hover { color: var(--text); }
.ptabs button.on { color: var(--text); border-bottom-color: var(--text); }
.ptabs .tab-label { display: none; }

.pgrid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 3px; }
.pgrid > .sentinel, .pgrid > .empty, .pgrid > .private-note, .pgrid > .panel { grid-column: 1 / -1; }
.ptile { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--panel); }
.ptile.tall { aspect-ratio: 2 / 3; }
.ptile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ptile-kind { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6)); }
.ptile-views {
  position: absolute; left: 10px; bottom: 9px; display: inline-flex; align-items: center; gap: 5px; color: #fff;
  font-size: 15px; font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.ptile-hover {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 22px; color: #fff;
  background: rgba(0, 0, 0, 0.42); font-weight: 800; font-size: 16px; opacity: 0; transition: opacity 0.15s;
}
.ptile-hover span { display: inline-flex; align-items: center; gap: 6px; }
@media (hover: hover) { .ptile:hover .ptile-hover, .ptile:focus-visible .ptile-hover { opacity: 1; } .ptile:hover .ptile-views { opacity: 0; } }
@media (min-width: 900px) { .pgrid { --cols: 4; } }
@media (min-width: 1280px) { .pgrid { --cols: 5; } }
@media (min-width: 1560px) { .pgrid { --cols: 6; } }

@media (max-width: 820px) {
  .phead { grid-template-columns: 96px 1fr; column-gap: 18px; padding: 0 14px; margin-top: 0; }
  .phead-face { justify-content: flex-start; }
  .phead .story-face .avatar { width: 86px !important; height: 86px !important; }
  .phead-row h1 { font-size: 19px; }
  .phead-menu { margin-left: auto; }
  .pstats { gap: 16px; font-size: 14px; }
  .phead > .profile-actions .button { padding: 0 8px; white-space: nowrap; }
  .ptabs button { flex: 1; }
}
@media (max-width: 420px) { .pstats { flex-wrap: wrap; gap: 4px 14px; } }

/* ---------- edit profile page */
.edit-page { max-width: 640px; gap: 16px; }
.edit-form { display: flex; flex-direction: column; gap: 16px; }
.edit-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); flex-wrap: wrap; }
.edit-card .grow { display: flex; flex-direction: column; min-width: 120px; flex: 1; }
.edit-card label.button { cursor: pointer; }
.edit-face .avatar, .edit-face img { width: 64px !important; height: 64px !important; border-radius: 50%; object-fit: cover; }
.edit-group { gap: 18px; }
.edit-field { display: flex; flex-direction: column; gap: 7px; }
.edit-field > label, .edit-field > .field-label { font-weight: 700; font-size: 14.5px; color: var(--text); }
.edit-field .counter { align-self: flex-end; }
.edit-field input:disabled { opacity: 0.6; }
.edit-buttons { display: flex; justify-content: flex-end; gap: 10px; }
.edit-buttons .button { min-width: 120px; }
.link-row { color: var(--text); }
.link-row .icon { color: var(--muted); }
.private-value { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.edit-field > .button.small { align-self: flex-start; }
.edit-page .fine a { color: var(--link); }
.mark-ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.auth .forgot { align-self: flex-end; font-size: 13.5px; }
