/* Times · feed (v2) — an app-like feed of Times photographs and their picture-book panels. */

:root {
  --bg: #fff;
  --text: #000;
  --text2: #737373;
  --sep: #dbdbdb;
  --blue: #0095f6;
  --blue-down: #1877f2;
  --link: #00376b;
  --heart: #ff3040;
  --elev: #fff;
  --hover: rgba(0, 0, 0, .05);
  --press: rgba(0, 0, 0, .08);
  --skel: #efefef;
  --field: #efefef;
  --btn2: #efefef;
  --btn2-hover: #dbdbdb;
  --contain: #f2f2f2;
  --dot: #c7c7c7;
  --seen: #c7c7c7;
  --grab: #c7c7c7;
  --toast: #262626;
  --gapc: var(--bg);
  --esep: #dbdbdb;
  --ring: linear-gradient(45deg, #feda75 5%, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5 95%);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --script: "Grand Hotel", "Snell Roundhand", "Brush Script MT", cursive;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --tabbar: 50px;
  --mh: 44px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --text: #f5f5f5;
    --text2: #a8a8a8;
    --sep: #262626;
    --link: #e0f1ff;
    --elev: #262626;
    --hover: rgba(255, 255, 255, .1);
    --press: rgba(255, 255, 255, .14);
    --skel: #1c1c1c;
    --field: #262626;
    --btn2: #363636;
    --btn2-hover: #262626;
    --contain: #121212;
    --dot: #4d4d4d;
    --seen: #363636;
    --grab: #555;
    --toast: #363636;
    --esep: #363636;
    color-scheme: dark;
  }
}

/* ---------- base */

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  overflow-anchor: none;
  background: var(--bg);
}
html.locked { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 18px;
  overflow-wrap: anywhere;
}
[hidden] { display: none !important; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  text-align: inherit;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
/* one bold weight everywhere (the UA's "bolder" inside a 600 heading would give 900) */
b, strong { font-weight: 600; }
img { display: block; }
/* every fallback failed: a neutral box, never the broken-image glyph or spilled alt text */
img.broken { visibility: hidden; }
svg { display: block; flex: 0 0 auto; }
.ico { width: 24px; height: 24px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus-visible { outline: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* skip link: first stop for keyboard users */
.skip {
  position: fixed;
  left: 8px;
  top: -60px;
  z-index: 500;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--elev);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .2);
}
.skip:focus { top: calc(8px + var(--sat)); }
.wordmark {
  font-family: var(--script);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1;
  color: var(--text);
}
.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* generic round icon button */
.ib {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  transition: opacity .12s;
}
.ib:active { opacity: .5; }
@media (hover: hover) and (pointer: fine) {
  .ib:hover { opacity: .6; }
}

/* monogram avatar: bold serif T on a cream disc (SVG symbol i-mono in app.js, scales with its box) */
.mono {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  user-select: none;
  -webkit-user-select: none;
}

/* ring avatar: gradient = unseen story, grey = seen */
.rav {
  --s: 32px;
  --rw: 2px;
  --gw: 2px;
  position: relative;
  flex: 0 0 auto;
  width: calc(var(--s) + 2 * (var(--rw) + var(--gw)));
  height: calc(var(--s) + 2 * (var(--rw) + var(--gw)));
  border-radius: 50%;
  padding: var(--rw);
  display: grid;
  place-items: center;
}
.rav-in {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: var(--gw) solid var(--gapc);
  overflow: hidden;
  background: var(--skel);
  display: grid;
}
.rav-in > img, .rav-in > .mono { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* ring photos show once decoded (the class change also repaints them; see showWhenDecoded) */
.rav-in > img { opacity: 0; transition: opacity .15s; }
.rav-in > img.loaded { opacity: 1; }
.rav.unseen { background: var(--ring); }
.rav.seen { background: var(--seen); padding: 1px; }
.rav.seen .rav-in { border-width: calc(var(--gw) + var(--rw) - 1px); }
.rav.quiet.seen { background: none; }

/* ---------- skeletons */

.sk { background: var(--skel); animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { 50% { opacity: .55; } }
.sk-ring { width: 71px; height: 71px; border-radius: 50%; }
.sk-line { height: 10px; border-radius: 5px; }
.sk-st .sk-line { margin: 3px 0; }
.sk-post { padding-bottom: 20px; }
.sk-head { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; }
.sk-av { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; }
.sk-media { aspect-ratio: 1.91; width: 100%; }
.sk-st { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 0 0 auto; width: 74px; }
/* below the media: the action row's room, then the like line and two caption lines on the post's own 18px lines */
.sk-acts { height: 46px; }
.sk-txt { display: flex; flex-direction: column; align-items: flex-start; padding: 0 12px; }
.sk-txt .sk-line { margin-top: 4px; margin-bottom: 4px; }
@media (min-width: 768px) {
  .sk-ring { width: 67px; height: 67px; }
  .sk-head { padding: 0 0 12px; min-height: 0; }
  .sk-media { border-radius: 4px; }
  .sk-txt { padding: 0; }
}

/* ---------- app frame */

.sb-shim {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--sat);
  background: var(--bg);
  z-index: 45;
}
main { min-height: 100vh; }
.view { min-height: 100vh; }

/* mobile header (per view) */
.mh {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  height: calc(var(--mh) + var(--sat));
  padding: var(--sat) calc(8px + var(--sar)) 0 calc(16px + var(--sal));
  background: var(--bg);
  will-change: transform;
}
.mh-word { font-size: 31px; padding: 4px 4px 0 0; }
.mh-sp { flex: 1; }
.mh-title {
  flex: 1;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mh-handle { font-size: 20px; line-height: 24px; font-weight: 700; flex: 1; }
.mh-post { padding-left: calc(4px + var(--sal)); border-bottom: 1px solid var(--sep); }
.mh-post .ib, .mh-post .mh-pad { flex: 0 0 40px; }

/* bottom tab bar */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  height: calc(var(--tabbar) + var(--sab));
  padding: 0 var(--sar) var(--sab) var(--sal);
  background: var(--bg);
  border-top: 1px solid var(--sep);
}
.tab {
  flex: 1;
  height: var(--tabbar);
  display: grid;
  place-items: center;
  color: var(--text);
  transition: opacity .12s;
}
.tab:active { opacity: .5; }
.tab .ico { width: 26px; height: 26px; }
.tab .i-on, .side-item .i-on { display: none; }
.tab[aria-current] .i-on, .side-item[aria-current] .i-on { display: block; }
.tab[aria-current] .i-off, .side-item[aria-current] .i-off { display: none; }
.tab-av { width: 28px; height: 28px; border-radius: 50%; padding: 2px; border: 2px solid transparent; display: grid; }
.tab[aria-current] .tab-av, .side-item[aria-current] .tab-av { border-color: var(--text); }

/* desktop sidebar */
.side { display: none; }

@media (max-width: 767px) {
  main { padding-bottom: calc(var(--tabbar) + var(--sab)); }
  .d-only { display: none !important; }
}

@media (min-width: 768px) {
  .tabbar, .mh, .sb-shim, .m-only { display: none !important; }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: calc(73px + var(--sal));
    padding: calc(8px + var(--sat)) 12px calc(20px + var(--sab)) calc(12px + var(--sal));
    background: var(--bg);
    border-right: 1px solid var(--sep);
  }
  main { margin-left: calc(73px + var(--sal)); }
}

.side-brand {
  display: flex;
  align-items: center;
  height: 92px;
  padding: 26px 12px 18px;
  margin-bottom: 4px;
}
.side-brand .wordmark { display: none; font-size: 33px; padding-top: 6px; }
.side-brand .side-mono {
  width: 26px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 38px;
  line-height: 30px;
  padding-top: 4px;
  transition: transform .15s;
}
.side-items { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-item {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
  padding: 12px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 20px;
  transition: background .12s;
}
.side-item .si-ico { width: 24px; height: 24px; display: grid; place-items: center; transition: transform .15s; }
.side-item .tab-av { width: 26px; height: 26px; padding: 1px; }
.side-item .si-label { display: none; white-space: nowrap; }
.side-item[aria-current] .si-label { font-weight: 700; }
.side-item:active { opacity: .6; }
@media (hover: hover) and (pointer: fine) {
  .side-item:hover { background: var(--hover); }
  .side-item:hover .si-ico, .side-brand:hover .side-mono { transform: scale(1.06); }
}

@media (min-width: 1264px) {
  .side { width: calc(245px + var(--sal)); }
  main { margin-left: calc(245px + var(--sal)); }
  .side-brand .wordmark { display: block; }
  .side-brand .side-mono { display: none; }
  .side-item .si-label { display: block; }
}

/* desktop search panel: the sidebar collapses to its icon rail while it is open */
.side-item.is-open { box-shadow: inset 0 0 0 1px var(--sep); }
.side-item.is-open .i-on { display: block; }
.side-item.is-open .i-off { display: none; }
body.sp-open .side-item[aria-current]:not(.is-open) .i-on { display: none; }
body.sp-open .side-item[aria-current]:not(.is-open) .i-off { display: block; }
body.sp-open .side-item[aria-current]:not(.is-open) .tab-av { border-color: transparent; }
body.sp-open .side-item[aria-current]:not(.is-open) .si-label { font-weight: 400; }
@media (min-width: 1264px) {
  body.sp-open .side { width: calc(73px + var(--sal)); }
  body.sp-open .side-brand .wordmark, body.sp-open .side-item .si-label { display: none; }
  body.sp-open .side-brand .side-mono { display: grid; }
}
.spanel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: calc(73px + var(--sal));
  z-index: 39;
  width: 397px;
  max-width: calc(100vw - 73px - var(--sal));
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 0 16px 16px 0;
  border-right: 1px solid var(--sep);
  box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
  animation: sp-in .22s ease both;
}
@keyframes sp-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sp-title { font-size: 24px; line-height: 30px; font-weight: 600; padding: 24px 24px 36px; }
.sp-field {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  margin: 0 16px;
  border-radius: 8px;
  background: var(--field);
}
.sp-glass { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text2); display: grid; pointer-events: none; }
.sp-glass .ico { width: 16px; height: 16px; }
.sp-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 36px 0 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.sp-field input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.sp-field input::placeholder { color: var(--text2); }
.sp-field:focus-within .sp-glass { display: none; }
.sp-field:focus-within input { padding-left: 16px; }
.sp-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--text2);
}
.sp-clear .ico { width: 16px; height: 16px; }
.sp-list { flex: 1; overflow-y: auto; margin-top: 24px; border-top: 1px solid var(--sep); padding: 12px 0; overscroll-behavior: contain; }
.sp-h { padding: 4px 24px 8px; font-size: 16px; line-height: 20px; font-weight: 600; }
.sp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 24px;
  text-align: left;
}
.sp-row:active { background: var(--press); }
.sp-row:focus-visible { outline-offset: -2px; }
.sp-thumb { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--skel); flex: none; }
.sp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sp-txt { min-width: 0; display: flex; flex-direction: column; }
.sp-txt b, .sp-txt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-txt b { font-weight: 600; }
.sp-txt span { color: var(--text2); }
.sp-empty { padding: 24px; color: var(--text2); text-align: center; }
.sp-all { display: block; width: 100%; padding: 14px 24px; color: var(--blue); font-weight: 600; text-align: left; }
@media (hover: hover) and (pointer: fine) {
  .sp-row:hover { background: var(--hover); }
  .sp-all:hover { color: var(--text); }
}
@media (max-width: 767px) { .spanel { display: none !important; } }

/* blue button (load error) */
.btn-blue {
  height: 32px;
  margin-top: 16px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
}
.btn-blue:active { opacity: .7; }
@media (hover: hover) and (pointer: fine) { .btn-blue:hover { background: var(--blue-down); } }

/* ---------- home */

.home { display: flex; justify-content: center; }
.home-col { width: 100%; max-width: 630px; min-width: 0; }
.feed { max-width: 470px; margin: 0 auto; }

@media (min-width: 768px) {
  .home-col { padding-top: 16px; }
}

/* stories tray */
.tray-wrap { position: relative; }
.tray {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 12px 10px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  scroll-padding: 0 12px;
}
.tray::-webkit-scrollbar { display: none; }
.st {
  flex: 0 0 auto;
  width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: opacity .12s;
}
.st:active { opacity: .6; }
.st .rav { --s: 60px; --rw: 2.5px; --gw: 3px; }
.st-label {
  display: block;
  max-width: 74px;
  font-size: 12px;
  line-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.tray-nav {
  position: absolute;
  top: 30px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #262626;
  display: none;
  place-items: center;
  box-shadow: 0 0 5px rgba(0, 0, 0, .2);
}
.tray-nav .ico { width: 14px; height: 14px; }
.tray-nav.prev { left: 6px; }
.tray-nav.next { right: 6px; }
@media (hover: hover) and (pointer: fine) {
  .tray-nav:not([hidden]) { display: grid; }
}
@media (min-width: 768px) {
  .tray { padding: 8px 4px 16px; gap: 14px; margin-bottom: 8px; }
  .st .rav { --s: 56px; --rw: 2.5px; --gw: 3px; }
}

/* ---------- post */

.post { position: relative; padding-bottom: 14px; }
.ph {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 4px 8px 8px;
}
.ph-av { border-radius: 50%; flex: 0 0 auto; }
.ph-av:active { opacity: .7; }
.ph .rav { --s: 32px; --rw: 2px; --gw: 2px; }
.ph-txt { flex: 1; min-width: 0; }
.ph-l1 { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; line-height: 18px; }
.uname { font-weight: 600; color: var(--text); }
.ph-dot, .ph-age { color: var(--text2); }
.ph-dot { font-size: 12px; }
.ph-loc {
  display: block;
  font-size: 12px;
  line-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
@media (hover: hover) and (pointer: fine) {
  .uname:hover, .ph-loc:hover { opacity: .7; }
}

/* carousel */
.car {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--skel);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  outline-offset: -3px;
}
.car-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: manipulation;
}
.car-track::-webkit-scrollbar { display: none; }
.car-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  overflow: hidden;
}
.car-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .2s;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.car-slide.is-contain img { object-fit: contain; }
.car-slide.is-contain.loaded, .car-slide.failed { background: var(--contain); }
.car-slide.loaded img { opacity: 1; }
.car-count {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 9px;
  border-radius: 14px;
  background: rgba(18, 18, 18, .72);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  letter-spacing: .02em;
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.car-count.show { opacity: 1; }
.car-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .86);
  color: #262626;
  display: none;
  place-items: center;
  box-shadow: 0 0 5px rgba(0, 0, 0, .18);
  transition: background .12s, opacity .12s;
}
.car-nav .ico { width: 16px; height: 16px; }
.car-nav.prev { left: 10px; }
.car-nav.next { right: 10px; }
.car-nav:active { opacity: .7; }
@media (hover: hover) and (pointer: fine) {
  .car:hover .car-nav:not([hidden]), .car:focus-within .car-nav:not([hidden]) { display: grid; }
  .car-nav:hover { background: #fff; }
}

/* focus rings for media boxes: drawn above the slides/images */
.car:focus-visible, .tile:focus-visible { outline: none; }
.car:focus-visible::after, .tile:focus-visible::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  box-shadow: inset 0 0 0 3px var(--blue);
  pointer-events: none;
}

/* double-tap heart */
.burst {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 3;
}
.burst svg {
  width: 104px;
  height: 104px;
  color: #fff;
  opacity: 0;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .28));
}
.burst.go svg { animation: burst 1.05s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes burst {
  0% { opacity: 0; transform: scale(.2) rotate(-12deg); }
  14% { opacity: 1; transform: scale(1.18) rotate(4deg); }
  24% { transform: scale(.92) rotate(-2deg); }
  34% { transform: scale(1.04) rotate(0); }
  42% { transform: scale(1); }
  74% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(.55) translateY(-46px); }
}

/* dots */
.dots {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 4px;
  pointer-events: none;
}
.dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
  transition: background .2s, transform .2s;
}
.dots i.on { background: var(--blue); }
.dots.in { top: auto; bottom: 14px; transform: translateX(-50%); z-index: 2; }
.dots.in i { background: rgba(255, 255, 255, .45); }
.dots.in i.on { background: var(--blue); }

/* action row */
.pa {
  position: relative;
  display: flex;
  align-items: center;
  height: 46px;
  padding: 2px 4px 0;
}
.pa .ib .ico { width: 24px; height: 24px; }
.pa-sp { flex: 1; }
.like .i-on, .save .i-on { display: none; }
.like[aria-pressed="true"] .i-on, .save[aria-pressed="true"] .i-on { display: block; }
.like[aria-pressed="true"] .i-off, .save[aria-pressed="true"] .i-off { display: none; }
.like[aria-pressed="true"] { color: var(--heart); }
.like.pop svg, .save.pop svg { animation: pop .45s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop {
  0% { transform: scale(1); }
  25% { transform: scale(1.28); }
  55% { transform: scale(.9); }
  100% { transform: scale(1); }
}

/* text block */
.pc { padding: 0 12px; }
/* caption: two lines, cut in JS so "… more" follows the last whole word that fits; the clamp is only a guard */
.pc { line-height: 18px; cursor: default; }
.pc-in {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pc.open .pc-in { display: block; -webkit-line-clamp: unset; line-clamp: unset; }
.pc.cut { cursor: pointer; }
.pc-cut { white-space: nowrap; }
.pc-more { color: var(--text2); line-height: 18px; vertical-align: baseline; }
@media (hover: hover) and (pointer: fine) {
  .pc-more:hover { color: var(--text); }
}
.tag { color: var(--link); }
@media (hover: hover) and (pointer: fine) {
  .tag:hover { text-decoration: underline; }
}

@media (min-width: 768px) {
  .feed .post { padding-bottom: 18px; margin-bottom: 14px; border-bottom: 1px solid var(--sep); }
  .feed .ph { padding: 0 0 12px 0; min-height: 0; }
  .feed .car { border-radius: 4px; box-shadow: 0 0 0 1px var(--sep); }
  .feed .pa { padding: 4px 0 0 0; margin-left: -8px; margin-right: -8px; }
  .feed .pc { padding: 0; }
}

/* end of feed */
.caught {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px 44px;
  text-align: center;
}
.caught .ring-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 2px;
  background: var(--ring);
  display: grid;
}
.caught .ring-check span {
  border-radius: 50%;
  background: var(--bg);
  display: grid;
  place-items: center;
  color: var(--text);
}
.caught h2 { font-size: 20px; line-height: 25px; font-weight: 400; margin-top: 8px; }
.caught p { color: var(--text2); }
.caught a { color: var(--blue); font-weight: 600; margin-top: 6px; }
.sent { height: 1px; }
/* no box of its own: spacers changing above the posts never move a box on screen (see listBottom in app.js) */
.feed-list { display: contents; }
.feed-pad { pointer-events: none; }
.feed-end { height: 64px; }

/* spinner */
.spinner { width: 32px; height: 32px; animation: spin 1s steps(8) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- explore */

.xh {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--sat) + 6px) calc(16px + var(--sar)) 8px calc(16px + var(--sal));
  background: var(--bg);
}
.xs {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  min-width: 0;
  padding: 0 8px 0 12px;
  border-radius: 10px;
  background: var(--field);
  color: var(--text2);
  cursor: text;
}
.xs .ico { width: 18px; height: 18px; }
.xs input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.xs input::placeholder { color: var(--text2); }
.xs input::-webkit-search-cancel-button { display: none; }
.xs-clear { width: 22px; height: 22px; display: grid; place-items: center; color: var(--text2); }
.xs-clear .ico { width: 18px; height: 18px; }
.x-cancel { font-size: 16px; color: var(--text); white-space: nowrap; }
.x-meta { padding: 4px 16px 10px; color: var(--text2); }
.x-meta b { color: var(--text); font-weight: 600; }
.x-empty { padding: 64px 24px; text-align: center; color: var(--text2); }
.x-empty h2 { font-size: 16px; color: var(--text); margin-bottom: 6px; font-weight: 600; }

@media (min-width: 768px) {
  .xv { max-width: 975px; margin: 0 auto; padding: 0 20px 40px; }
  .xh { position: static; padding: 28px 0 20px; }
  .xs { max-width: 400px; height: 40px; border-radius: 8px; }
  .x-meta { padding: 0 0 14px; }
}
/* 15px only with a mouse: on touch screens (a phone in landscape, a tablet) under 16px makes iOS zoom into the field */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .xs input { font-size: 15px; }
}

/* grid of square tiles */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
}
@media (min-width: 768px) { .grid { gap: 4px; } }
.tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--skel);
  outline-offset: -3px;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .2s;
  -webkit-touch-callout: none;
}
.tile img.loaded { opacity: 1; }
.tile .multi {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  color: #fff;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, .45));
}
.tile-hov {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(0, 0, 0, .32);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 20px;
  text-align: center;
  opacity: 0;
  transition: opacity .15s;
}
.tile { -webkit-touch-callout: none; }
.tile:active img { opacity: .8; }

/* long-press peek on touch grids */
.peek {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, .28);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
}
.peek.show { opacity: 1; }
.peek-card {
  width: min(420px, 100%);
  border-radius: 14px;
  overflow: hidden;
  background: var(--elev);
  box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
  transform: scale(.88);
  transition: transform .22s cubic-bezier(.2, .9, .3, 1.2);
}
.peek.show .peek-card { transform: none; }
.peek-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.peek-head .mono { width: 32px; height: 32px; flex: 0 0 auto; }
.peek-media { width: 100%; background: var(--skel); }
.peek-media img { width: 100%; height: 100%; object-fit: cover; }
.peek-acts { display: flex; justify-content: space-around; padding: 6px 0 8px; color: var(--text); }
.peek-acts .ico { width: 24px; height: 24px; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .tile-hov, .tile:focus-visible .tile-hov { opacity: 1; }
}

/* ---------- profile */

.pf-top {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 24px;
  padding: 12px calc(16px + var(--sar)) 0 calc(16px + var(--sal));
}
.pf-av { width: 86px; height: 86px; border-radius: 50%; }
.pf-name-m { font-weight: 600; margin-bottom: 6px; }
.pf-handle { display: none; }
.pf-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 260px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pf-stats li { display: flex; flex-direction: column; line-height: 18px; }
.pf-stats b { font-size: 16px; font-weight: 600; line-height: 20px; }
.pf-bio { grid-column: 1 / -1; padding-top: 12px; line-height: 18px; }
.pf-bio .pf-name { display: none; font-weight: 600; }
.pf-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: var(--link);
  font-weight: 600;
}
.pf-link .ico { width: 14px; height: 14px; }
.pf-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 14px calc(16px + var(--sar)) 0 calc(16px + var(--sal));
}
.btn2 {
  height: 32px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--btn2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  white-space: nowrap;
  transition: background .12s;
}
.btn2:active { opacity: .7; }
@media (hover: hover) and (pointer: fine) { .btn2:hover { background: var(--btn2-hover); } }
.pf-hl {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 18px calc(16px + var(--sar)) 14px calc(16px + var(--sal));
  overscroll-behavior-x: contain;
}
.pf-hl::-webkit-scrollbar { display: none; }
/* the row's chevrons (edgeNav in app.js) sit on the middle of the rings */
.pf-hl-wrap { position: relative; }
.pf-hl-wrap .tray-nav { top: 39px; }
.hl { flex: 0 0 auto; width: 66px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hl:active { opacity: .6; }
.hl .rav { --s: 60px; --rw: 1px; --gw: 3px; background: var(--seen); padding: 1px; }
.hl span:last-child {
  max-width: 66px;
  font-size: 12px;
  line-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-tabs { display: flex; border-bottom: 1px solid var(--sep); }
.pf-tab {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text2);
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
}
.pf-tab span { display: none; }
.pf-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.pf-empty { padding: 56px 32px; text-align: center; }
.pf-empty .circ {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border: 2px solid var(--text);
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.pf-empty .circ .ico { width: 30px; height: 30px; }
.pf-empty h2 { font-size: 24px; line-height: 30px; font-weight: 800; margin-bottom: 10px; }
.pf-empty p { color: var(--text2); max-width: 340px; margin: 0 auto; }

@media (min-width: 768px) {
  .pf { max-width: 935px; margin: 0 auto; padding: 30px 20px 40px; }
  .pf-top { grid-template-columns: 283px 1fr; align-items: start; gap: 0; padding: 0 0 30px; }
  .pf-av { width: 150px; height: 150px; justify-self: center; grid-row: 1 / span 3; }
  .pf-name-m { display: none; }
  .pf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 8px; margin: 10px 0 20px; }
  .pf-handle {
    display: block;
    max-width: 100%;
    font-size: 20px;
    line-height: 25px;
    font-weight: 400;
    margin-right: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pf-stats { justify-content: flex-start; gap: 40px; max-width: none; margin-bottom: 20px; }
  .pf-stats li { flex-direction: row; gap: 5px; font-size: 16px; line-height: 20px; }
  .pf-stats b { font-size: 16px; }
  .pf-bio { grid-column: 2; padding-top: 0; }
  .pf-bio .pf-name { display: block; }
  .pf-btns { display: none; }
  .pf-hl { gap: 40px; padding: 10px 0 44px 30px; }
  .pf-hl-wrap .tray-nav { top: 40px; }
  .hl { width: 87px; }
  .hl .rav { --s: 77px; --gw: 4px; }
  .hl span:last-child { max-width: 87px; font-weight: 600; }
  .pf-tabs { justify-content: center; gap: 60px; border-bottom: 0; border-top: 1px solid var(--sep); }
  .pf-tab {
    flex: 0 0 auto;
    height: 52px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 0;
    border-top: 1px solid transparent;
    margin: -1px 0 0;
  }
  .pf-tab .ico { width: 12px; height: 12px; }
  .pf-tab span { display: inline; }
  .pf-tab[aria-selected="true"] { border-top-color: var(--text); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  /* the icon-rail layout: a narrower avatar column leaves the handle and its buttons one row */
  .pf-top { grid-template-columns: 190px 1fr; }
}
@media (max-width: 767px) {
  .pf-head { display: none; }
}

/* ---------- post page / detail (desktop) */

.pv-more { padding: 20px 0 32px; }
.pv-more h2 {
  padding: 4px 12px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
}
.pv-more h2 b { color: var(--text); font-weight: 600; }
@media (min-width: 768px) {
  .pv { max-width: 975px; margin: 0 auto; padding: 24px 20px 40px; }
  .pv-card { display: flex; justify-content: center; }
  .pv-card .dt { border: 1px solid var(--sep); border-radius: 4px; }
  .pv-more { border-top: 1px solid var(--sep); margin-top: 48px; padding-top: 40px; }
  .pv-more h2 { padding: 0 0 20px; }
}

.dt {
  display: flex;
  background: var(--bg);
  overflow: hidden;
}
.dt-media {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  background: #000;
}
.dt-media .car { background: #111; }
.dt-side {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--sep);
}
.dt-side .ph { padding: 14px 4px 14px 14px; border-bottom: 1px solid var(--sep); min-height: 0; }
.dt-comments { flex: 1 1 auto; overflow-y: auto; padding: 4px 0 8px; overscroll-behavior: contain; }
.dt-foot { border-top: 1px solid var(--sep); padding-bottom: 8px; }
.dt-foot .pa { padding: 4px 6px 0; }
.dt-off { border-top: 1px solid var(--sep); padding: 14px 16px; color: var(--text2); text-align: center; }
/* side by side the card is exactly the media's height: the carousel fills it (no letterbox from rounding) */
.dt:not(.stack) .dt-media .car { height: 100%; aspect-ratio: auto !important; }
.dt.short .dt-off { display: none; }
/* narrow windows: one column (header, media, actions, comments), as on the phone */
.dt.stack { flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
.dt.stack .dt-side { display: contents; }
.dt.stack .dt-side .ph { order: -1; flex: none; padding: 8px 4px 8px 12px; border-bottom: 0; }
.dt.stack .dt-media { order: 0; flex: none; }
.dt.stack .dt-foot { order: 1; flex: none; border-top: 0; }
.dt.stack .dt-comments { order: 2; flex: none; overflow: visible; border-top: 1px solid var(--sep); }
.dt.stack .dt-off { order: 3; flex: none; }

/* comment rows */
.cm { display: flex; align-items: flex-start; gap: 12px; padding: 12px 8px 12px 16px; }
.cm-av { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; background: var(--skel); }
.cm-av img { width: 100%; height: 100%; object-fit: cover; }
.cm-body { flex: 1; min-width: 0; }
.cm-top { display: flex; align-items: baseline; gap: 6px; line-height: 16px; margin-bottom: 2px; }
.cm-author { font-weight: 600; font-size: 13px; }
.cm-time { font-size: 12px; color: var(--text2); }
.cm-text { white-space: pre-line; line-height: 18px; }
.cm-label { margin-top: 6px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text2); }
.cm-like { width: 32px; height: 32px; display: grid; place-items: center; color: var(--text2); flex: 0 0 auto; margin-top: 2px; }
.cm-like .ico { width: 14px; height: 14px; }
.cm-like[aria-pressed="true"] { color: var(--heart); }
.cm-like .i-on { display: none; }
.cm-like[aria-pressed="true"] .i-on { display: block; }
.cm-like[aria-pressed="true"] .i-off { display: none; }
.cm.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { background: var(--hover); } 100% { background: transparent; } }
.cm-off {
  flex: 0 0 auto;
  padding: 14px 16px;
  border-top: 1px solid var(--esep);
  color: var(--text2);
  text-align: center;
  font-size: 13px;
}

/* ---------- overlays: sheets, dialogs, modal */

.ov { position: fixed; inset: 0; z-index: 100; }
.ov-back {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  transition: opacity .28s ease;
  touch-action: none;
}
.ov.open .ov-back { opacity: 1; }
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - var(--sat) - 32px);
  padding-bottom: var(--sab);
  background: var(--elev);
  border-radius: 14px 14px 0 0;
  transform: translateY(100%);
  transition: transform .34s cubic-bezier(.2, .85, .25, 1);
  overscroll-behavior: contain;
  will-change: transform;
}
.ov.open .sheet { transform: none; }
.ov.closing .sheet { transition-duration: .24s; transition-timing-function: cubic-bezier(.4, 0, 1, 1); }
.sheet:focus { outline: none; }
.sheet-head { flex: 0 0 auto; touch-action: none; cursor: grab; position: relative; }
.grab { width: 36px; height: 4px; border-radius: 2px; background: var(--grab); margin: 8px auto 4px; }
.sheet-title {
  padding: 10px 48px 14px;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid var(--esep);
}
.sheet-x { position: absolute; right: 4px; top: 4px; display: none; }
.sheet-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.sheet-comments { height: 62vh; height: 62dvh; }
.sheet-comments .cm:first-child { padding-top: 16px; }

.opt-list { padding: 4px 0 6px; }
.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  font-size: 16px;
  line-height: 20px;
  text-align: left;
  transition: background .1s;
}
.opt:active { background: var(--press); }
.opt.cancel { justify-content: center; border-top: 1px solid var(--esep); margin-top: 4px; }
.opt-sub { display: block; font-size: 12px; line-height: 16px; color: var(--text2); }

@media (min-width: 768px) {
  .ov-back { background: rgba(0, 0, 0, .65); }
  .sheet {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: min(400px, calc(100vw - 40px));
    max-height: min(80vh, 640px);
    padding-bottom: 0;
    border-radius: 12px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.12);
    transition: transform .14s ease-out, opacity .14s ease-out;
  }
  .ov.open .sheet { opacity: 1; transform: translate(-50%, -50%); }
  .ov.closing .sheet { transition-duration: .1s; }
  .grab { display: none; }
  .sheet-head { cursor: default; }
  .sheet-title { padding: 12px 48px; }
  .sheet-x { display: grid; }
  .sheet-comments { height: auto; width: min(480px, calc(100vw - 40px)); }
  .opt-list { padding: 0; }
  .opt {
    justify-content: center;
    min-height: 48px;
    padding: 4px 8px;
    font-size: 14px;
    border-top: 1px solid var(--esep);
    text-align: center;
  }
  .opt:first-child { border-top: 0; }
  .opt .ico { display: none; }
  .opt.cancel { margin-top: 0; }
  @media (hover: hover) { .opt:hover { background: var(--hover); } }
}

/* desktop post modal */
.ov-modal .ov-back { background: rgba(0, 0, 0, .65); }
.md-box {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 4px;
  overflow: hidden;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.04);
  transition: opacity .16s ease-out, transform .16s ease-out;
}
.ov.open .md-box { opacity: 1; transform: translate(-50%, -50%); }
.md-box .dt { width: 100%; height: 100%; }
.md-x {
  position: absolute;
  top: calc(8px + var(--sat));
  right: calc(8px + var(--sar));
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
}
.md-x .ico { width: 26px; height: 26px; }
.md-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #000;
  display: grid;
  place-items: center;
}
.md-nav .ico { width: 18px; height: 18px; }
.md-nav.prev { left: calc(20px + var(--sal)); }
.md-nav.next { right: calc(20px + var(--sar)); }
.md-nav:hover { background: #fff; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + var(--sab) + 14px);
  z-index: 400;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--toast);
  color: #fff;
  font-size: 14px;
  line-height: 18px;
  box-shadow: 0 4px 22px rgba(0, 0, 0, .2);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity .22s, transform .22s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 768px) { .toast { bottom: 28px; } }
/* in the story viewer the footer (See post, like, share) owns the bottom: the toast shows under the header */
html.sv-on .toast { top: calc(var(--sat) + 72px); bottom: auto; transform: translate(-50%, -12px); }
html.sv-on .toast.show { transform: translate(-50%, 0); }

/* ---------- story viewer */

.sv {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  color: #fff;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  --gapc: #000;
}
.sv:focus { outline: none; }
.sv-stage { position: absolute; inset: 0; perspective: 1100px; perspective-origin: 50% 50%; }
.sv-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-top: var(--sat);
  background: #000;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-origin: 50% 50%;
}
.sv-card {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: min(calc(100vw * 16 / 9), calc(100vh - var(--sat) - var(--sab) - 60px));
  height: min(calc(100vw * 16 / 9), calc(100dvh - var(--sat) - var(--sab) - 60px));
  border-radius: 10px;
  overflow: hidden;
  background: #121212;
}
.sv-media { position: absolute; inset: 0; overflow: hidden; }
.sv-blur {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  object-fit: cover;
  filter: blur(34px) saturate(1.25) brightness(.72);
  transform: translateZ(0);
}
.sv-fg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .18s;
}
.sv-face.ready .sv-fg { opacity: 1; }
.sv-blur, .sv-fg { -webkit-touch-callout: none; -webkit-user-drag: none; pointer-events: none; }
.sv-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -16px 0 0 -16px;
  color: rgba(255, 255, 255, .8);
  opacity: 0;
  transition: opacity .2s .4s;
}
.sv-face:not(.ready) .sv-loading { opacity: 1; }
.sv-shade {
  position: absolute;
  inset: 0 0 auto 0;
  height: 120px;
  background: linear-gradient(rgba(0, 0, 0, .42), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.sv-bars {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  gap: 3px;
}
.sv-bar {
  flex: 1 1 0;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .35);
  overflow: hidden;
}
.sv-bar i {
  display: block;
  height: 100%;
  background: #fff;
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.sv-head {
  position: absolute;
  top: 16px;
  left: 12px;
  right: 2px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.sv-av { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; background: #333; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }
.sv-av img { width: 100%; height: 100%; object-fit: cover; }
.sv-who { flex: 1; min-width: 0; text-shadow: 0 0 6px rgba(0, 0, 0, .25); display: flex; align-items: center; gap: 10px; text-align: left; color: #fff; }
.sv-who-t { min-width: 0; flex: 1; }
.sv-l1 { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; line-height: 18px; overflow: hidden; }
.sv-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sv-age { color: rgba(255, 255, 255, .72); flex: none; }
.sv-l2 {
  display: block;
  font-size: 12px;
  line-height: 16px;
  color: rgba(255, 255, 255, .9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sv-ib {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: 0 0 auto;
  border-radius: 50%;
}
.sv-ib:active { opacity: .55; }
.sv-ib .ico { filter: drop-shadow(0 0 3px rgba(0, 0, 0, .25)); }
.sv-x .ico { width: 28px; height: 28px; }
.sv-cap {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 24px;
  z-index: 2;
  max-width: 440px;
  margin: 0 auto;
  padding: 9px 5px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .48);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 14px;
  line-height: 19px;
  text-align: center;
}
.sv-cap-t {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* the clamp's "…" is drawn past the centred last line's end: this padding is the room it needs (the box
     clips at its padding edge), so all three dots show */
  padding: 0 8px;
}
.sv-foot {
  flex: 1 0 60px;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 8px calc(8px + var(--sar)) var(--sab) calc(12px + var(--sal));
}
.sv-see {
  flex: 1;
  min-width: 0;
  height: 44px;
  margin-right: 6px;
  padding: 0 10px 0 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
  color: #fff;
}
.sv-see:active { background: rgba(255, 255, 255, .12); }
.sv-see span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-see .ico { width: 18px; height: 18px; }
.sv-foot .like[aria-pressed="true"] { color: var(--heart); }
.sv-dim { position: absolute; inset: 0; z-index: 9; background: #000; opacity: 0; pointer-events: none; }
.sv-bars, .sv-head, .sv-cap, .sv-foot > *, .sv-shade { transition: opacity .2s; }
.sv.held .sv-bars, .sv.held .sv-head, .sv.held .sv-cap, .sv.held .sv-foot > *, .sv.held .sv-shade { opacity: 0; }
.sv-brand, .sv-close, .sv-chev, .sv-sides { display: none; }

@media (min-width: 768px) {
  .sv { background: #1a1a1a; --h: min(calc(100vh - 32px), 960px); --w: calc(var(--h) * 9 / 16); --gapc: #1a1a1a; }
  .sv-face {
    inset: auto;
    left: 50%;
    top: 50%;
    width: var(--w);
    height: var(--h);
    padding-top: 0;
    border-radius: 8px;
    overflow: hidden;
    transform: translate(-50%, -50%);
  }
  .sv-card { height: 100%; border-radius: 8px; }
  .sv-foot {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 3;
    padding: 28px 8px 14px 14px;
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .45));
  }
  .sv-cap { bottom: 86px; }
  .sv-brand {
    display: block;
    position: absolute;
    top: calc(18px + var(--sat));
    left: calc(22px + var(--sal));
    font-size: 33px;
    color: #fff;
  }
  .sv-close { display: grid; position: absolute; top: calc(10px + var(--sat)); right: calc(10px + var(--sar)); z-index: 5; }
  .sv-close .ico { width: 30px; height: 30px; }
  .sv-chev {
    display: grid;
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .88);
    color: #262626;
    place-items: center;
  }
  .sv-chev .ico { width: 16px; height: 16px; }
  .sv-chev.prev { left: calc(50% - var(--w) / 2 - 45px); }
  .sv-chev.next { left: calc(50% + var(--w) / 2 + 15px); }
  .sv-chev:hover { background: #fff; }
  .sv-sides { display: block; }
  .sv-side {
    position: absolute;
    top: 50%;
    width: calc(var(--h) * .2025);
    height: calc(var(--h) * .36);
    transform: translateY(-50%);
    border-radius: 8px;
    overflow: hidden;
    background: #222;
    color: #fff;
    transition: transform .15s;
  }
  .sv-side:hover { transform: translateY(-50%) scale(1.03); }
  .sv-side-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.38) saturate(.9); }
  .sv-side-in {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    text-align: center;
  }
  .sv-side .rav { --s: 52px; --rw: 2.5px; --gw: 3px; --gapc: #2a2a2a; }
  .sv-side-name { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .sv-side-age { font-size: 12px; color: rgba(255, 255, 255, .7); }
  .sv-side.sl1 { left: calc(50% - var(--w) / 2 - 60px - var(--h) * .2025); }
  .sv-side.sl2 { left: calc(50% - var(--w) / 2 - 88px - var(--h) * .405); }
  .sv-side.sr1 { left: calc(50% + var(--w) / 2 + 60px); }
  .sv-side.sr2 { left: calc(50% + var(--w) / 2 + 88px + var(--h) * .2025); }
}

/* Small story cards (short windows, phones in landscape): the chrome tightens so the name, age, pause and
   "See post" never overlap or wrap, and the caption shrinks so it stays clear of the fitted panel. */
.sv-face { container: svface / size; }
@container svface (max-width: 300px) {
  .sv-bars { top: 6px; left: 6px; right: 6px; }
  .sv-head { top: 12px; left: 8px; right: 0; gap: 6px; }
  .sv-who { gap: 8px; }
  .sv-av { width: 28px; height: 28px; }
  .sv-l1 { gap: 6px; font-size: 13px; }
  .sv-ib { width: 40px; height: 40px; }
  .sv-see { height: 40px; margin-right: 2px; padding: 0 8px 0 12px; gap: 4px; font-size: 14px; }
  .sv-cap { left: 10px; right: 10px; padding: 6px 1px; font-size: 13px; line-height: 17px; }
  .sv-cap-t { -webkit-line-clamp: 3; }
}
@container svface (max-width: 230px) {
  .sv-see { justify-content: center; padding: 0 10px; }
  .sv-see .ico { display: none; }
}
@container svface (max-height: 560px) {
  .sv-cap { padding: 6px 1px; font-size: 12.5px; line-height: 16px; }
  .sv-cap-t { -webkit-line-clamp: 2; }
}
@media (max-width: 767px) {
  /* phone in landscape: the panel fills the short card, so the caption keeps to one line near the edge */
  @container svface (max-height: 420px) {
    .sv-cap { bottom: 10px; }
    .sv-cap-t { -webkit-line-clamp: 1; }
  }
}
@media (min-width: 768px) {
  @container svface (max-width: 300px) {
    .sv-foot { padding: 20px 6px 10px 10px; }
    .sv-cap { bottom: 76px; }
  }
  @container svface (max-height: 560px) {
    .sv-foot { padding: 20px 6px 10px 10px; }
    .sv-cap { bottom: 76px; }
  }
}

/* ---------- motion preferences */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .burst { display: none; }
  .sk { animation: none; }
}
