/* Interactive feed. The mobile dialog lives in the browser's top layer. */
.tiktok-viewport-probe { position: fixed; inset: 0; width: 100vw; height: 100dvh; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); box-sizing: border-box; contain: strict; visibility: hidden; pointer-events: none; }
.tiktok-entry,
.tiktok-mobile-back { display: none; }
.tiktok-player { margin: 0; padding: 0; border: 0; background: #000; color: #fff; }
.tiktok-player::backdrop { background: #000; }
.phone-stage button,
.phone-stage a { -webkit-tap-highlight-color: transparent; }
.phone-stage button { font: inherit; cursor: pointer; }
.phone-stage button:focus-visible,
.phone-stage a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.tiktok-post-deck { touch-action: pan-y; overscroll-behavior: none; }
.tiktok-player .tiktok-post-deck:focus-visible { outline: none; }
.tiktok-player.has-keyboard-focus .tiktok-post-deck:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.phone-video { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.tiktok-ambient { position: absolute; z-index: -1; inset: -24px; width: calc(100% + 48px); max-width: none; height: calc(100% + 48px); object-fit: cover; filter: blur(24px) brightness(.42) saturate(.8); pointer-events: none; }
.tiktok-post .phone-video { object-fit: contain; }
.tiktok-continue { display: none; }

.tiktok-feed-tabs { pointer-events: none; }
.tiktok-feed-tabs > button {
  position: relative;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.72);
  font-size: 16px;
  font-weight: 600;
  text-shadow: 0 1px 4px #0006;
  pointer-events: auto;
}
.tiktok-feed-tabs > .is-selected { color: #fff; font-weight: 750; }
.tiktok-feed-tabs > .is-selected::after {
  position: absolute;
  bottom: 1px;
  left: 24%;
  right: 24%;
  height: 3px;
  border-radius: 2px;
  background: #fff;
  content: "";
}
.tiktok-sound-toggle { width: 44px; height: 44px; }
.tiktok-action-rail { right: 6px; bottom: 18px; gap: 12px; width: 48px; }
.tiktok-action-rail > button {
  display: grid;
  width: 48px;
  min-height: 44px;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}
.tiktok-action-rail > button > small { font: 700 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; text-shadow: 0 1px 3px #0008; }
.tiktok-action-rail [data-feed-action="like"][aria-pressed="true"] svg { fill: #fe2c55; stroke: #fe2c55; }
.tiktok-action-rail [data-feed-action="save"][aria-pressed="true"] svg { fill: #f5cf55; stroke: #f5cf55; }
.tiktok-action-rail .tiktok-rail-avatar { width: 46px; height: 46px; margin-bottom: 7px; border: 1.5px solid #fff; }
.tiktok-action-rail .tiktok-rail-avatar > small { right: 12px; bottom: -8px; width: 20px; height: 20px; font-size: 16px; }
.tiktok-action-rail .tiktok-music-disc { width: 44px; height: 44px; margin: 0; }
.tiktok-post:not(.is-active) .tiktok-music-disc,
.tiktok-post.is-paused .tiktok-music-disc { animation-play-state: paused; }
.tiktok-post-copy { right: 72px; bottom: 18px; }
.tiktok-post-copy p { font-size: 14px; line-height: 1.4; }
.tiktok-caption-toggle { min-height: 32px; margin: 0; padding: 0 10px 0 0; border: 0; background: transparent; color: #fffd; font-size: 13px !important; font-weight: 600 !important; text-shadow: inherit; }
.tiktok-post-copy > span { margin-top: 0; }
.is-caption-expanded .tiktok-post-copy p { display: block; max-height: min(32dvh, 240px); overflow-y: auto; overscroll-behavior: contain; }
.is-caption-expanded::after { height: 70%; background: linear-gradient(transparent, #000c 60%); }
.tiktok-like-burst { position: absolute; z-index: 26; color: #fe2c55; font: 96px/1 Arial, sans-serif; opacity: 0; pointer-events: none; filter: drop-shadow(0 3px 10px #0003); }
.tiktok-video-progress { height: 2px; opacity: .8; }
.tiktok-post:hover .tiktok-video-progress { height: 2px; }
.tiktok-post.is-paused .tiktok-video-progress,
.tiktok-post.is-seeking .tiktok-video-progress,
.tiktok-video-progress:focus-within { height: 5px; opacity: 1; }
.tiktok-video-progress input {
  position: absolute;
  inset: auto 0 -9px;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
}
.tiktok-video-progress input::-webkit-slider-runnable-track { height: 3px; background: transparent; }
.tiktok-video-progress input::-moz-range-track { height: 3px; background: transparent; }
.tiktok-video-progress input::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4.5px; appearance: none; -webkit-appearance: none; border-radius: 50%; background: transparent; }
.tiktok-video-progress input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: transparent; }
.is-seeking input::-webkit-slider-thumb,
.is-paused input::-webkit-slider-thumb,
.tiktok-video-progress input:focus-visible::-webkit-slider-thumb { background: #fff; }
.is-seeking input::-moz-range-thumb,
.is-paused input::-moz-range-thumb,
.tiktok-video-progress input:focus-visible::-moz-range-thumb { background: #fff; }
.tiktok-seek-time { position: absolute; bottom: 44px; left: 50%; padding: 6px 12px; border-radius: 6px; background: #000b; color: #fff; font: 600 16px/1.5 -apple-system, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; transform: translateX(-50%); opacity: 0; pointer-events: none; }
.is-seeking .tiktok-seek-time { opacity: 1; }
.is-buffering .tiktok-video-progress::after { position: absolute; inset: 0 auto 0 0; width: 30%; background: #fff; content: ""; animation: tiktok-loading 1s ease-in-out infinite alternate; }
@keyframes tiktok-loading { to { transform: translateX(230%); } }
.phone-stage [data-video-play]:focus-visible { z-index: 40; top: 45%; left: 50%; width: 140px !important; height: 48px !important; padding: 8px !important; margin: 0 !important; border: 1px solid #fff !important; border-radius: 8px; clip: auto !important; clip-path: none !important; background: #000c; color: #fff; transform: translateX(-50%); }
.phone-stage [data-video-play]:focus-visible::after { content: attr(aria-label); }

.tiktok-bottom-nav > button,
.tiktok-bottom-nav > a { display: grid; min-width: 0; min-height: 44px; align-content: center; justify-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: #fffc; text-decoration: none; }
.tiktok-bottom-nav > .is-active { color: #fff; }
.tiktok-bottom-nav { grid-template-columns: 1fr 1fr minmax(108px, 1.9fr) 1fr 1fr; gap: 2px; }
.tiktok-bottom-nav > .tiktok-collab-cta { display: flex; min-height: 44px; justify-content: center; gap: 8px; margin-inline: 3px; padding: 7px 10px; border: 1px solid #ffffff36; border-radius: 999px; background: #fff; color: #111; font-size: 14px; font-weight: 750; white-space: nowrap; box-shadow: 0 3px 20px #0003; }
.tiktok-cta-arrow { display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; border-radius: 50%; background: #fe2c55; color: #fff; font-size: 19px; }
.tiktok-bottom-nav > .tiktok-collab-cta:active { transform: scale(.97); }
.tiktok-toast { position: absolute; z-index: 45; bottom: calc(90px + var(--player-safe-bottom, env(safe-area-inset-bottom, 0px))); left: 50%; width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 8px; background: #202020ee; color: #fff; font: 600 13px/1.4 -apple-system, sans-serif; text-align: center; opacity: 0; transform: translate(-50%, 8px); transition: opacity .15s, transform .15s; pointer-events: none; }
.tiktok-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.tiktok-sheet { position: fixed; inset: auto 0 0; width: min(100%, 440px); max-width: 100%; max-height: min(78dvh, 720px); margin: 0 auto; padding: 0 20px max(20px, var(--player-safe-bottom, env(safe-area-inset-bottom, 0px))); overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: 18px 18px 0 0; background: #fafafa; color: #161616; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.tiktok-sheet[open] { animation: tiktok-sheet-in .22s ease-out; }
.tiktok-sheet::backdrop { background: #0007; }
@keyframes tiktok-adaptive-sheet-in { from { transform: translate(-50%, -85%); opacity: .5; } to { transform: translate(-50%, -100%); opacity: 1; } }
@keyframes tiktok-sheet-in { from { transform: translateY(15%); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
.tiktok-sheet-handle { width: 36px; height: 4px; margin: 9px auto 0; border-radius: 4px; background: #d5d5d5; }
.tiktok-sheet header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 14px; }
.tiktok-sheet h3 { margin: 0; color: #161616; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.tiktok-sheet [data-close-sheet] { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #eee; color: #161616; font-size: 28px; }
.tiktok-sheet button:focus-visible,
.tiktok-sheet a:focus-visible { outline-color: #161616; outline-offset: 2px; }
.tiktok-sheet h4 { margin: 0 0 12px; font-size: 20px; letter-spacing: -.02em; }
.tiktok-sheet p { margin: 0 0 16px; color: #565656; }
.tiktok-sheet-primary,
.tiktok-sheet-secondary { display: grid; width: 100%; min-height: 48px; margin: 12px 0 0; padding: 12px 16px; place-items: center; border: 0; border-radius: 6px; background: #fe2c55; color: #fff; font-weight: 700; text-decoration: none; }
.tiktok-sheet-secondary { background: #eee; color: #161616; }
.tiktok-profile-card { text-align: center; }
.tiktok-profile-card > img { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; object-fit: cover; }
.tiktok-gallery-filters { display: flex; gap: 8px; margin-bottom: 16px; }
.tiktok-gallery-filters button { min-height: 44px; padding: 8px 16px; border: 0; border-radius: 6px; background: #eee; color: #555; font-weight: 700; }
.tiktok-gallery-filters [aria-pressed="true"] { background: #161616; color: #fff; }
.tiktok-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiktok-gallery > button { position: relative; display: block; padding: 0; overflow: hidden; aspect-ratio: 9 / 12; border: 0; border-radius: 6px; background: #161616; color: #fff; text-align: left; }
.tiktok-gallery img { width: 100%; height: 100%; object-fit: cover; }
.tiktok-gallery span { position: absolute; inset: auto 0 0; padding: 24px 8px 10px; background: linear-gradient(transparent, #000d); font-size: 12px; font-weight: 600; line-height: 1.4; }
.tiktok-gallery > p { grid-column: 1 / -1; }
.tiktok-sheet input { width: 100%; min-height: 44px; margin-top: 8px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; color: #161616; background: #fff; font-size: 16px; }
.tiktok-collab-intro { font-size: 16px; }
.tiktok-collab-options { display: grid; gap: 8px; margin: 20px 0; }
.tiktok-collab-options article { padding: 14px 16px; border: 1px solid #e3e3e3; border-radius: 10px; background: #f1f1f1; }
.tiktok-collab-options h4 { margin-bottom: 4px; font-size: 16px; }
.tiktok-collab-options p { margin: 0; font-size: 14px; line-height: 1.45; }
.tiktok-contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin-top: 20px; }
.tiktok-contact-links a { min-height: 44px; padding: 10px 0; font-size: 14px; font-weight: 650; text-decoration: underline; text-underline-offset: 4px; }

@media (min-width: 1024px) {
  .phone-stage { top: 64px; height: calc(100dvh - 64px); padding: 12px 0; overflow: visible; }
  .iphone-device { height: min(772px, calc(100dvh - 88px)); width: min(356px, calc((100dvh - 88px) * .52)); border-radius: 40px; padding: 9px; }
  .iphone-screen { border-radius: 32px; }
  .tiktok-feed-tabs { top: 36px; }
  .tiktok-bottom-nav { padding-inline: 2px; }
  .tiktok-bottom-nav small { font-size: 11px; }
  .tiktok-action-rail { gap: 7px; }
}

@media (max-width: 1023px) {
  html.tiktok-feed-active { overflow: hidden; overscroll-behavior: none; background: #000; color-scheme: dark; }
  /* Safari paints its edge insets from the page canvas, not just the modal. */
  html.tiktok-feed-active body { background: #000; }
  html.tiktok-feed-active .site-header { display: none; }
  html.tiktok-feed-active .scroll-progress { visibility: hidden; }
  .work-story[data-player-ready] > .phone-stage { display: none; }
  .work-story[data-player-ready] .tiktok-entry { position: relative; display: grid; width: 100%; height: 100%; min-height: 100svh; padding: 0; overflow: hidden; place-items: center; border: 0; background: #000; color: #fff; cursor: pointer; }
  .tiktok-entry > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .6; }
  .tiktok-entry > span { position: relative; display: grid; justify-items: center; gap: 12px; font-size: 24px; font-weight: 700; text-shadow: 0 1px 10px #0006; }
  .tiktok-entry small { font-size: 14px; font-weight: 400; }
  .tiktok-entry-play { display: grid; width: 72px; height: 72px; padding-left: 4px; place-items: center; border: 1px solid #fff8; border-radius: 50%; background: #fff2; font-size: 25px; }
  .tiktok-player[open] { position: fixed; inset: var(--player-top, 0px) auto auto var(--player-left, 0px); width: var(--player-width, 100%); max-width: none; height: var(--player-height, 100dvh); max-height: none; min-width: 0; min-height: 0; overflow: hidden; overscroll-behavior: none; }
  .tiktok-player[data-frame="cover"] .phone-video { object-fit: cover; }
  .tiktok-player[data-frame="contain"] .phone-video { object-fit: contain; }
  .tiktok-player .tiktok-sheet { inset: auto; top: calc(var(--player-top, 0px) + var(--player-height, 100dvh)); left: calc(var(--player-left, 0px) + var(--player-width, 100vw) / 2); width: min(440px, var(--player-width, 100vw)); max-height: min(calc(var(--player-height, 100dvh) * .78), 720px, calc(var(--player-height, 100dvh) - var(--player-safe-top, 0px) - 12px)); margin: 0; transform: translate(-50%, -100%); }
  .tiktok-player .tiktok-sheet[open] { animation-name: tiktok-adaptive-sheet-in; }
  .tiktok-player[open] .phone-stage { position: relative; inset: auto; display: block; width: 100%; height: 100%; padding: 0; overflow: hidden; }
  .tiktok-player[open] .iphone-device { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; aspect-ratio: auto; box-shadow: none; contain: none; transform: none; }
  .tiktok-player[open] .iphone-screen { width: 100%; height: 100%; border-radius: 0; contain: none; transform: none; }
  .tiktok-player .tiktok-mobile-back { position: absolute; z-index: 32; top: calc(var(--player-safe-top, env(safe-area-inset-top, 0px)) + 6px); left: max(6px, var(--player-safe-left, env(safe-area-inset-left, 0px))); display: grid; width: 44px; height: 44px; padding: 0 0 5px; place-items: center; border: 0; background: transparent; color: #fff; font: 42px/1 Arial, sans-serif; text-shadow: 0 1px 5px #0006; }
  .tiktok-feed-tabs { top: calc(var(--player-safe-top, env(safe-area-inset-top, 0px)) + 6px); gap: 24px; }
  .tiktok-sound-toggle { top: calc(var(--player-safe-top, env(safe-area-inset-top, 0px)) + 56px); right: max(6px, var(--player-safe-right, env(safe-area-inset-right, 0px))); }
  .tiktok-post-deck { inset: 0; height: 100%; }
  .tiktok-post::after { height: 34%; background: linear-gradient(transparent, #000b 70%, #000e); }
  .tiktok-bottom-nav { height: calc(72px + var(--player-safe-bottom, env(safe-area-inset-bottom, 0px))); padding: 8px max(8px, var(--player-safe-right, env(safe-area-inset-right, 0px))) max(14px, var(--player-safe-bottom, env(safe-area-inset-bottom, 0px))) max(8px, var(--player-safe-left, env(safe-area-inset-left, 0px))); border-top: 1px solid #ffffff14; background: #111a; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
  .tiktok-bottom-nav small { font-size: 12px; }
  .tiktok-bottom-nav svg { width: 23px; height: 23px; }
  .tiktok-post-copy { bottom: calc(100px + var(--player-safe-bottom, env(safe-area-inset-bottom, 0px))); }
  .tiktok-video-progress { bottom: calc(79px + var(--player-safe-bottom, env(safe-area-inset-bottom, 0px))); left: 12px; right: 12px; }
  .tiktok-action-rail { right: max(6px, var(--player-safe-right, env(safe-area-inset-right, 0px))); bottom: calc(104px + var(--player-safe-bottom, env(safe-area-inset-bottom, 0px))); gap: clamp(6px, calc(var(--player-height, 100dvh) * .014), 12px); }
  .tiktok-continue { display: inline-flex; min-height: 36px; align-items: center; gap: 10px; margin: 8px 0 0; padding: 6px 12px; border: 1px solid #fff3; border-radius: 999px; background: #ffffff18; color: #fff; font-size: 13px !important; font-weight: 650 !important; }
}
/* Fill a portrait phone edge-to-edge; retain the whole frame on wider screens. */
@media (max-width: 600px) and (max-aspect-ratio: 3 / 4) {
  .tiktok-player:not([data-frame]) .tiktok-post .phone-video { object-fit: cover; }
}
@media (max-width: 1023px) {
  .tiktok-player:is([data-viewport="compact"], [data-viewport="short"]) .tiktok-action-rail { bottom: calc(99px + var(--player-safe-bottom, env(safe-area-inset-bottom, 0px))); gap: 5px; }
  .tiktok-player:is([data-viewport="compact"], [data-viewport="short"]) .tiktok-action-rail svg { width: 28px; height: 28px; }
  .tiktok-player:is([data-viewport="compact"], [data-viewport="short"]) .tiktok-action-rail > button { gap: 2px; }
  .tiktok-player:is([data-viewport="compact"], [data-viewport="short"]) .tiktok-action-rail .tiktok-rail-avatar { width: 40px; height: 40px; min-height: 40px; }
  .tiktok-player:is([data-viewport="compact"], [data-viewport="short"]) .tiktok-action-rail .tiktok-rail-avatar > small { right: 9px; }
  .tiktok-player:is([data-viewport="compact"], [data-viewport="short"]) .tiktok-action-rail .tiktok-music-disc { display: none; }
  .tiktok-player:is([data-viewport="compact"], [data-viewport="short"]) .tiktok-post-copy > span { font-size: 12px; }
}
@media (max-width: 1023px) {
  .tiktok-player[data-viewport="short"] .tiktok-action-rail { right: 52px; }
  .tiktok-player[data-viewport="short"] .tiktok-action-rail .tiktok-rail-avatar { display: none; }
  .tiktok-player[data-viewport="short"] .tiktok-post-copy { right: 112px; max-width: 480px; }
  .tiktok-player[data-viewport="short"] .tiktok-post-copy > span { display: none; }
  .tiktok-player[data-viewport="short"] .tiktok-sheet { max-height: calc(var(--player-height, 100dvh) - 12px); }
}
@media (min-width: 1024px) and (max-height: 680px) {
  .tiktok-feed-statusbar, .iphone-island { display: none; }
  .tiktok-feed-tabs { top: 2px; }
  .tiktok-sound-toggle { top: 44px; }
  .tiktok-action-rail .tiktok-music-disc { display: none; }
  .tiktok-action-rail { gap: 5px; }
  .tiktok-action-rail svg { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .tiktok-sheet[open],
  .is-buffering .tiktok-video-progress::after { animation: none; }
  .tiktok-toast { transition: none; }
}
